Repository navigation
Fix PHPStan errors for optional embed provider match flags - #99
swissspidy wants to merge 1 commit into
Conversation
Read the optional `limit-response-size` and `link-type` flags directly so PHPStan knows they can be null. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HsH4o5pKmm1Qd5cqwAm7vB
|
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 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough
ChangesProvider option handling
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~4 minutes Change: Refactor Suggested reviewers: Merge Risk: ⚪ Minimal · up to The optional provider flags retain their null defaults in the inspected WP-CLI implementation. No actionable merge-blocking risk is established by this change. 🚥 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! |
|
Closing in favour of fixing the root cause in the Generated by Claude Code |
Fixes the PHPStan job failing on
main(run):The
get_flag_value()return type extension from wp-cli-tests resolves the type from the$assoc_argsarray shape but ignores that'limit-response-size'?and'link-type'?are optional keys, so it dropsnullfrom the result.This reads the two flags with
$assoc_args[ ... ] ?? nullinstead, which is exactly whatget_flag_value()does internally (isset() ? value : default), so there is no behavior change. The underlying extension issue should also be fixed in wp-cli-tests.Verified locally with PHPStan 2.3.0:
composer phpstanreports no errors;composer phpcspasses.🤖 Generated with Claude Code
https://claude.ai/code/session_01HsH4o5pKmm1Qd5cqwAm7vB
Generated by Claude Code
Summary by CodeRabbit