-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PHPStan #672
Add PHPStan #672
Conversation
Love this first step to stricter code. |
@DannyvdSluijs You've done some great work in the past days/weeks, thanks! Tried to merge, resolved conflicts, but ran into some issues. Could you check them? Did the merge based on your work in the previous PR's I just merged. |
@stephangroen thanks for merging all those PR's. I've pushed a fix. This was caused from changes from main being merged in, mostly because some issues from the baseline where already resolved in main. |
This PR introduces PHPStan and improves the source based on PHPStan findings. It also includes a GitHub action workflow to run the static analysis on every pull request making sure we won't introduce regression in future PR's. If an exception is needed the
phpstan-baseline.neon
can be regenerated. In this way there is a way around if the static analysis step would block a PR.I see this as a first set of improvements to make the exact-php-client more type safe and "free from bugs" both promises PHPStan is being used by in the PHP industry standards. Follow-up PR's could consist of
phpstan-baseline.neon
, work is in progress in Upgrade phpunit #668 (Guzzle Response namespace was corrected in tests) as well as upstream in Improvements based on phpstan feedback downstream DannyvdSluijs/PicqerExactPhpClientGenerator#2 where results from running PHPStan in this library have been used to correct the code generating the models here.