Exclude the wp-compat false positive from the PHPStan config - #162
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 5.3 merely formalized the already documented `...$arg` parameter of `do_action()` by adding it to the function signature, so passing the server instance to `rest_api_init` 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 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughPHPStan configuration now suppresses the targeted WordPress compatibility warning for the ChangesPHPStan compatibility configuration
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This localized PHPStan configuration change suppresses one documented false positive without changing runtime or product behavior; 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.inc/Runner.php:115Parameter $arg of do_action() is only available since WordPress version 5.3.0...$argparameter by adding it to the function signature". Before that,do_action()collected additional arguments throughfunc_get_args(), so passing theWP_REST_Serverinstance torest_api_inithas always workedIgnored by error identifier and path. No message scoping was needed:
WPCompat.parameterNotAvailable.doaction.argalready names one specific parameter of one specific function, so the entry cannot swallow an unrelated diagnostic.This adds the
ignoreErrorskey tophpstan.neon.dist, which did not have one.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 errors, with no unmatched ignore entriesignore.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