Bump PHPStan rule level to 4#11037
Conversation
This makes it easier to use this branch for cherrypicking/remediation, even if the eventual version of _this_ pr will need to be downgraded back down to 1.x
Co-authored-by: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com>
Co-authored-by: John Blackbourn <johnbillion@git.wordpress.org>
Co-authored-by: John Blackbourn <john@johnblackbourn.com>
Co-authored-by: John Blackbourn <john@johnblackbourn.com>
…into feat/phpstan
The generate-baselines.sh script now automatically reads the maximum level from phpstan.neon or phpstan.neon.dist instead of using a hardcoded value. Additionally, the script was updated to use indexed arrays for compatibility with Bash 3.2 (macOS default), and the README was updated to reflect these changes and fix minor typos. Co-authored-by: gemini-cli <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…into feat/phpstan
…for callable-string
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
This PR is based off of #7619, see additional commits: justlevine/wordpress-develop@feat/phpstan...westonruter:wordpress-develop:bump/phpstan-level-4
Trac ticket: https://core.trac.wordpress.org/ticket/64680
By increasing the PHPStan rule level to 4, the following issues will begin to be detected for new code introduced to core:
__calland__get$this), validating PHPDocsinstanceofand other type checks, deadelsebranches, unreachable code after return; etc.Existing errors for these levels are ignored by a baseline which has been updated to include 641 errors:
Use of AI Tools
Summarizing the ignored errors in the baseline.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.