craftcms / rector

Rector rules for updating plugins and modules to Craft CMS 4.
19 stars 6 forks source link

Call to undefined method PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode::getParamImmediatelyInvokedCallableTagValues() is back #22

Closed sunscreem closed 6 months ago

sunscreem commented 6 months ago

Description

I'm upgrading a Craft 4 site to Craft 5 and following their instructions for upgrading a custom plugin.

When running vendor/bin/rector process [directory] --config vendor/craftcms/rector/sets/craft-cms-50.php the process seems to run okay (the progress bar appears). Then I get this error multiple times (different file names) and no changes are made.

[ERROR] Could not process "plugins/[x]/src/variables/[x].php" file, due to:  
         "Call to undefined method                                                                        
         PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode::getParamImmediatelyInvokedCallableTagValues()". On   
         line: 307  

Steps to reproduce

  1. Install as per Craft instructions
  2. Run the command above.

Additional info

The version of the this I'm using is dev-main

sunscreem commented 6 months ago

It maybe the same issue as https://github.com/craftcms/rector/pull/19, however I can confirm my vendor/craftcms/rector/composer.json is requiring "rector/rector": "^0.19.2"

johnnynotsolucky commented 6 months ago

@sunscreem this can also be resolved by downgrading phpstan and phpdoc-parser:

    "require-dev": {
        ...
        "phpstan/phpdoc-parser": "1.26.0",
        "phpstan/phpstan": "1.10.60",
    }
sunscreem commented 6 months ago

@johnnynotsolucky @TomasVotruba All working now - using latest version. Thank you both.