Repository navigation
Fix PHPStan error: align Hook_Callbacks type with WP_Hook::$callbacks - #228
Conversation
… stub Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NDYX767HJCpR3xuCfhBTDm
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughThe ChangesCallback key type
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~3 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The type change matches the callback keys WordPress can retain, so this change presents no identified merge-blocking risk. 🚥 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✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
The WordPress stubs now declare
WP_Hook::$callbacksasarray<int, array<non-decimal-int-string, array{function: callable, accepted_args: int}>>. Our localHook_Callbacksalias still usedstringkeys, so assigning it back to the property inset_filter_callbacks()failedassign.propertyType(failing run).This PR narrows the inner key type of the alias to
non-decimal-int-stringto match the stub. This is a docblock-only change.Verified locally:
composer phpstanreports the error onmainand none with this change.composer phpcsis clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01NDYX767HJCpR3xuCfhBTDm
Generated by Claude Code
Summary by CodeRabbit