Fix PHPStan errors with WordPress 7.1 stubs - #44
Conversation
`WP_Filesystem_Base::abspath()` is now typed as `string|false`, so bail out with an error instead of building a bogus `.maintenance` path.
|
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 maintenance mode status check now validates the WordPress root path before constructing the ChangesMaintenance mode validation
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to The command now reports an error when the WordPress root cannot be resolved instead of constructing an invalid maintenance-file path. No actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
php-stubs/wordpress-stubsv7.1.0 tightened WP core types, which surfaced one new PHPStan error at level 9.WP_Filesystem_Base::abspath()is now typed asstring|false(it returnsfalsewhen the remote root cannot be located, e.g. over FTP). Passing that straight intotrailingslashit()no longer type-checks — and at runtime it would have silently produced/.maintenance. It now bails out with a proper error instead.PHPStan is clean again with the new stubs.
Generated by Claude Code
Summary by CodeRabbit