upgrade: Upgrade tool rector does not work on Cakephp 3.8.12

Hi,

I use CakePhp 3.8.12, php 7.4, win 10 and installed the upgrade tool in another folder than my cakephp folder.

I ran the up bin\cake upgrade rector --rules cakephp40 ..\relative\path\to\cakephp with debug mode because it got stuck at 0/412 => 0%

Here is the error I got :

Applying cakephp40 Rector rules
File "C:\webserver\www\cakephpUpgradeTool/vendor/autoload.php" is about to be loaded in "AutoloadIncluder::includeCwdVendorAutoloadIfExists()" on line 98"

Fatal error: Uncaught Error: Call to undefined method PhpParser\Comment::getEndLine() in phar://C:/webserver/www/cakephpUpgradeTool/vendor/phpstan/phpstan/phpstan.phar/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php:700
Stack trace:
#0 phar://C:/webserver/www/cakephpUpgradeTool/vendor/phpstan/phpstan/phpstan.phar/vendor/nikic/php-parser
/lib/PhpParser/Parser/Php7.php(361): PhpParser\ParserAbstract->createCommentNopAttributes(Array)
#1 phar://C:/webserver/www/cakephpUpgradeTool/vendor/phpstan/phpstan/phpstan.phar/vendor/nikic/php-parser
/lib/PhpParser/ParserAbstract.php(238): PhpParser\Parser\Php7->PhpParser\Parser\{closure}(17)
#2 phar://C:/webserver/www/cakephpUpgradeTool/vendor/phpstan/phpstan/phpstan.phar/vendor/nikic/php-parser
/lib/PhpParser/ParserAbstrac
File "C:\webserver\www\cakephpUpgradeTool\vendor\rector\rector/../../autoload.php" is about to be loaded in 
"AutoloadIncluder::autoloadProjectAutoloaderFile()" on line 132"
Rector v0.8.6

[parsing] Application.php

c/php-parser/lib/PhpParser/ParserAbstract.php(142): PhpParser\ParserAbstract->doParse()
#3 phar://C:/webserver/www/cakephpUpgradeTool/vendor/phpstan/phpstan/phpstan.phar/vendor/nikic/php-parser
/lib/PhpParser/Parser/Multiple.php(48): PhpParser\ParserAbstract->parse('<?php\n/**\n * Ca...', Object(PhpPa in phar://C:
/webserver/www/cakephpUpgradeTool/vendor/phpstan/phpstan/phpstan.phar/vendor/nikic/php-parser/lib/PhpParser
/ParserAbstract.php on line 700

During composer install --no-dev I also has this error : Class Cake\Composer\Installer\PluginInstaller is not autoloadable, can not call post-autoload-dump script

And for windows user, it doesn’t work when a folder has a space in its name.

Hope there is something to be done !

Thank you very much

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (6 by maintainers)

Most upvoted comments

@netfly you have tried to call rector directly or the upgrade tool directly with docker and php 7.3 ?

the update tool (in the docker)