Repository navigation
PHPStan: Update to 2.3.6 and phpstan-phpunit to 2.1.2 - #86922
westonruter wants to merge 2 commits into
Conversation
When only part of the project is analyzed, such as a single directory or a list of files, PHPStan 2.3.6 no longer reports `ignoreErrors` entries as unmatched merely because what they ignore lies outside the analysis. The result cache also now tracks the symbols each file looked up, rather than reanalyzing every file with errors on each run. The release adds full support for PHP 8.6 and float range types, along with many fixes to type narrowing. The analysis still reports no errors, and no ignore goes stale, so the baseline is unchanged. The `WP_REST_Request` offset ignores stay, since the PHPStan fix they wait on (phpstan/phpstan-src#6903) is not yet merged. Co-Authored-By: Claude Opus 5.5 (medium effort) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tnky3Grhn8Rv7MidzhrtXU Claude-Code-Session-Id: d102d8d5-ffa7-4c14-add5-1e05d41fe751
The extension now narrows types after `assertGreaterThan()` and `assertLessThan()`, and reports a data provider that provides no data sets. Neither changes what the analysis reports, so the baseline is unchanged. Co-Authored-By: Claude Opus 5.5 (medium effort) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tnky3Grhn8Rv7MidzhrtXU Claude-Code-Session-Id: d102d8d5-ffa7-4c14-add5-1e05d41fe751
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the ⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Navigates the list via UP/DOWN arrow keys from action buttons in
|
What?
See companion core PR: WordPress/wordpress-develop#16042
Updates PHPStan and its extensions to their latest releases:
phpstan/phpstan2.3.5 → 2.3.6float<0, 1.5>,finite-float, andpositive-float.ignoreErrorsentries for code outside the analysis are no longer reported as unmatched.isset(),count(),match (true)), fixes to inline@phpstan-ignorecomments in traits, and speedups such as baseline matching in time linear in the baseline's size.phpstan/phpstan-phpunit2.1.1 → 2.1.2assertGreaterThan()andassertLessThan().phpstan/phpstan-strict-rules(2.1.1),phpstan/extension-installer(1.4.3), andszepeviktor/phpstan-wordpress(2.0.4) are already at their latest versions.Why?
To keep Gutenberg's PHPStan setup in step with core's, which is being updated to the same versions in the companion PR. The partial-analysis fix also means analyzing a single file or directory no longer reports unrelated
ignore.unmatchederrors.How?
Bumps the two versions in
composer.json, one commit each. Neither update changes what the analysis reports for Gutenberg, so the baseline is unchanged; core's baselines do change, for reasons that don't apply here (see the companion PR). TheWP_REST_Requestoffset ignores inphpstan.neon.diststay, since the PHPStan fix they wait on (phpstan/phpstan-src#6903) is not yet merged.Testing Instructions
composer updatecomposer phpstan: it reports no errors.composer phpstan:baselines:tools/phpstan/baseline.neonis unchanged.Testing Instructions for Keyboard
N/A, no UI changes.
Screenshots or screencast
N/A
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5 (medium effort)
Used for: Updating the dependencies, checking the analysis and baseline, and drafting this description; directed and reviewed by me.