Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #298 +/- ##
===========================================
Coverage 100.00% 100.00%
+ Complexity 344 338 -6
===========================================
Files 48 48
Lines 1420 1413 -7
===========================================
- Hits 1420 1413 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR refactors the Y serializer's byte-escaping logic by replacing manual character-by-character loop processing with PHP's native strtr() function, resulting in cleaner, more performant code while maintaining identical behavior.
- Simplified
encode()method usingstrtr()with a translation table for null and escape bytes - Simplified
decode()method usingstrtr()with a translation table for escaped sequences - Reduced code complexity from ~30 lines to ~8 lines while preserving the same escape/unescape logic
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rmcdaniel
pushed a commit
that referenced
this pull request
Apr 16, 2026
Closes #298. The workflow package's WorkerProtocolVersion constant and the standalone server's history_page_size_default config had drifted: the package constant read 200 while the server advertises 500 in its server_capabilities response. The server is the authority on pagination size, so external workers already receive 500 at runtime; the constant was creating a documentation mismatch for SDK authors who referenced it. The package constant is the contract default that external workers and SDK authors should assume when the server has not advertised a value. Updated the docblock to name the authoritative server config key so future drift is obvious. 14 WorkerProtocolVersion tests (49 assertions) still pass — they reference the constant symbolically, not the literal value. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR simplifies and optimizes the Y serializer’s byte-escaping logic by replacing manual loops with a strtr-based implementation.