phpstan / phpdoc-parser

Next-gen phpDoc parser with support for intersection types and generics
MIT License
1.31k stars 62 forks source link

PHPStan report a Exception when upgrade to v1.10.34 #212

Closed rainx closed 12 months ago

rainx commented 12 months ago

What's happening

When I was trying to submit a PR https://github.com/phpstan/phpdoc-parser/pull/211 without any functional code update. the CI failed with the PHPStan job which should have run correctly before.

Compare with two CI workflows(before and after)

we found the main difference was for the installed dependencies. and the PHPStan just updated to v1.10.34 for the latest PR's CI job.

How to fix

  1. Lock the dependency version by adding the lock file to the repo. and let Renovate handle the dependencies updating. It assures every developer can get the same environment at different moments.
  2. Fix the PHPStan-reported issue in the main branch
rainx commented 12 months ago

Here is the output that PHPStan report in the workflow

php vendor/bin/phpstan
Note: Using configuration file /-----/---/phpdoc-parser/phpstan.neon.
 103/103 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ------------------------------------------------------------------------------------------------------------------- 
  Line   src/Ast/NodeTraverser.php                                                                                          
 ------ ------------------------------------------------------------------------------------------------------------------- 
         Ignored error pattern #^Strict comparison using \=\=\= between 2 and 2 will always evaluate to true\.$# in path    
          /-----/---/OpenSourceProjects/other/phpdoc-parser/src/Ast/NodeTraverser.php was not matched in reported errors.  
 ------ ------------------------------------------------------------------------------------------------------------------- 
rainx commented 12 months ago

To work around this. I submit a new commit in PR #211 https://github.com/phpstan/phpdoc-parser/pull/211/commits/0f4141384bba77347690d6a5f0c56fb868f986a3

ondrejmirtes commented 12 months ago

Please send that fix as a separate PR, I'm gonna smash that green button 😊

rainx commented 12 months ago

@ondrejmirtes done! check it out https://github.com/phpstan/phpdoc-parser/pull/214

github-actions[bot] commented 11 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.