You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHPstan skips analyzing traits when those traits are not in the analysis scope. I experimented with various ways of running phpstan, and after some diving into its internals with a debugger I managed to realize that this was the cause of why I got different results inside a vagrant guest and outside of it;
Since our custom code is not under drupal/web in the repo, I used symlinks to replicate the expected directory structure as a "virtual drupal root", which I passed to phpstan. Of course the real paths to those traits would not match the paths given to phpstan, so the traits would get skipped. (This should probably be filed as a bug against phpstan.)
For now my solution is to use rsync for setting up the directory structure for running from the command line.
With VS Code extension PHP Static Analysis I however do get the expected results using symlinks for the "virtual drupal root" and pointing phpstan.neon at it.
It will be great if method will be found from traits declaration. Till now phpstan cannot recognize it.
The text was updated successfully, but these errors were encountered: