Problem/Motivation
PHPStan is a tool that does static analysis on a codebase to find bugs. PHPStan is run in our CI pipeline. PHPStan groups its lints into rule levels.
Since #3586801: PHPStan level 1 we have been linting against PHPStan level 1.
But running ddev phpstan --level=5 locally shows only 13 things that need to be changed to get there, and they're all pretty trivial.
By observation, PHPStan level 5 is where it starts to provide really useful feedback (i.e.: find a lot of bugs), so this is great for maintainability.
Proposed resolution
Fix the 13 issues and update the rule level in phpstan.neon.
Remaining tasks
Merge request- merge request !12 created by @mparker17 in #3Commit- merged by @mparker17 in #4- Release
User interface changes
None.
API changes
None.
Data model changes
None.
Issue fork feedback-3586803
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mparker17For reference, the output from
ddev phpstan --level=5 --error-format=rawshows the following lints...Comment #5
mparker17Merged! I will update this issue when the code is released.