fix: remove duplicate jsonSerialize() in Note class#507
Conversation
Commit bd38494 (PR #491) added a second jsonSerialize() at line 156 after PR #503 (c0b1a63) had already added the canonical one at line 196. PHP fatal: Cannot redeclare WP_Ultimo\Objects\Note::jsonSerialize() crashes PHPUnit on PHP 8.2, 8.4, and 8.5. Same root cause as the Limitations fix in 7c66017 — two PRs solving issue #490 independently were merged in sequence without rebasing.
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ 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 |
🔨 Build Complete - Ready for Testing!📦 Download Build Artifact (Recommended)Download the zip build, upload to WordPress and test:
🌐 Test in WordPress Playground (Very Experimental)Click the link below to instantly test this PR in your browser - no installation needed! Login credentials: |
|
Performance Test Results Performance test results for c603cf2 are in 🛎️! URL:
|
Summary
jsonSerialize()method inNoteclass that causesPHP Fatal: Cannot redeclare WP_Ultimo\Objects\Note::jsonSerialize()on PHP 8.2, 8.4, and 8.5jsonSerialize()Root Cause Analysis
c0b1a630) addedjsonSerialize()afterto_array()with@since 2.0.11bd384940) added a secondjsonSerialize()beforeto_array()with@since 2.0.07c66017efixed the identical issue inLimitationsbut missedNoteWhy This Wasn't Caught
The
mainbranch has no branch protection rules. This means:mainare allowedRecommended Protections
To prevent this class of bug from reaching
main:mainwith:PHP 8.2,PHP 8.4,PHP 8.5jobs fromtests.yml)php -l) that catches syntax/redeclaration errors before the full test suite runsTesting
php -l inc/objects/class-note.phppassesjsonSerialize()methods exist in the codebase