Fix PHPStan errors with WordPress 7.1 stubs - #150
Conversation
wordpress-stubs v7.1.0 gives _get_cron_array() a precise return type, making the @var annotation in unschedule() wider than the inferred type.
|
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)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change removes an obsolete Changes
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This localized change removes a redundant type annotation while preserving the existing runtime check, with no actionable merge-blocking risk remaining beyond normal checks and review. 🚥 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. ✨ Finishing Touches📝 Generate docstrings
🧪 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! |
php-stubs/wordpress-stubsv7.1.0 tightened the types of WP core functions, which surfaced one new PHPStan error at level 9._get_cron_array()now has a precise return type, so the@var array<string, array<mixed>> $cronannotation inCron_Event_Command::unschedule()was wider than the type PHPStan already infers. Removed the redundant annotation; the defensiveis_array()runtime check is kept for older WordPress versions.PHPStan is clean again with no baseline or ignore entries.
Generated by Claude Code
Summary by CodeRabbit