Exclude the wp-compat false positive from the PHPStan config - #343
Exclude the wp-compat false positive from the PHPStan config#343swissspidy wants to merge 1 commit into
Conversation
The johnbillion/wp-compat extension that comes with wp-cli-tests checks every WordPress symbol against the WordPress 4.9 baseline that wp-cli-tests configures. It reported a single error, and it is a false positive: WordPress 6.0 merely formalized the already documented `...$args` parameter of `apply_filters()` by adding it to the function signature, so passing extra arguments to `upgrader_pre_download` has always worked. Co-authored-by: Pascal Birchler <pascal.birchler@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe PHPStan configuration adds an ignore rule for a WordPress compatibility diagnostic related to the variadic ChangesPHPStan compatibility
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This change excludes one documented PHPStan false positive without altering runtime behavior, and the reported analysis passes; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
The
johnbillion/wp-compatPHPStan extension that now ships withwp-cli-testschecks every WordPress symbol against the WordPress 4.9 baseline thatwp-cli-testsconfigures. It reported exactly one error here, and it is a false positive.src/WP_CLI/Core/CoreUpgrader.php:61Parameter $args of apply_filters() is only available since WordPress version 6.0.0...$argsparameter by adding it to the function signature". Before that,apply_filters()collected additional arguments throughfunc_get_args(), so passing the extra arguments toupgrader_pre_downloadhas always workedIgnored by error identifier and path, with the reason documented.
No source changes: nothing here is an actual compatibility problem.
Verification
Run locally against the same dependency versions CI resolves (
johnbillion/wp-compat2.0.0,php-stubs/wordpress-stubsv6.9.4,wp-cli/wp-cli-testsv5.2.3):composer phpstan—[OK] No errorsignore.unmatchederror, confirming the entry above matches a real error rather than sitting there unusedGitHub Actions was failing to allocate runners across the org while this was written, so CI may need a re-run once that clears.
Generated by Claude Code
Summary by CodeRabbit