Add a PHPStan configuration and run it as a GitHub Action #808
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
This PR adds in PHPStan as a dev dependency, along with the configuration to run that and a GitHub Action Workflow that will run on all PRs. I've also fixed up all issues that have been reported.
Right now I have this set to level 1 (lowest is 0, highest is 9). If I change this to level 2, there are 85 new things that get flagged (though most look to be pretty similar so solving a few should solve most of them). Ideally we bump this up to a higher level but I think starting at 1 is better than nothing.
How to test the Change
Verify the PHPStan Action runs and passes on this PR
Changelog Entry
Credits
Props @dkotter
Checklist: