Open neclimdul opened 2 years ago
If anyone one else runs into this, the immediate fix to get a analysis passing again was to add this to phpstan.neon
.
scanDirectories:
- vendor/drush/drush/src-symfony-compatibility/v4
Replace v4 with v6 if you're testing things in D10.
Ah yeah, the Symfony compatibility folder. I ran into this during a live stream with some other problem but cannot remember how it was worked around.
scanDirectories:
- vendor/drush/drush/src-symfony-compatibility/v4
Thank you @neclimdul ! This saved my š„ . For others following this thread, add this under the parameters:
section of your phpstan.neon file.
Don't know if this is something for this project but it seems like it might be able to help. When using DrushStyle with recent versions of Drush 11 you'll run into this problem:
This is caused by a fix they added dynamically load different classes to support Symfony 6 and changed method signatures. 06eb4a45296e409c6af9b592d8bec0f555adedd8 Looking at the commit there are a number of other classes this would affect as well.
The problem seems to be that the class lives outside packagist autoloading so phpstan isn't picking it up. Drush is adding the root dynamically during preflight sort of like drupal module namespaces but based on the detected Symfony version which... could make things complicated.