sveneld opened a new pull request, #3463: URL: https://github.com/apache/thrift/pull/3463
Refactor both type dispatchers in `lib/php/lib/Protocol/TProtocol.php` from `switch` to `match` expressions. **Why match:** - Strict comparison (`===`) instead of loose equality. - No fall-through hazard — every arm is bounded. - Direct return of arm value — eliminates per-case `return` boilerplate. **Structural changes:** - `skip()` — match arms delegate compound type handling (`STRUCT` / `MAP` / `SET` / `LIST`) to private helper methods since match arms accept only single expressions, not procedural blocks. - `skipBinary()` — same pattern; arms with identical fixed-byte sizes are merged (`BOOL`/`BYTE`, `I64`/`DOUBLE`, `SET`/`LST`). Behavior is preserved. The default arm still throws `TProtocolException`, matching the original API contract. **Validation (Docker `thrift-php-dev:local`):** - `phpcs` — 0 errors - `phpstan` (level 1) — 0 errors - `phpunit` Unit Suite — 635 tests, 0 failures - `phpunit` Integration Suite — 108 tests, 0 failures Part of the umbrella ticket [THRIFT-5960](https://issues.apache.org/jira/browse/THRIFT-5960) (PHP language modernization). - [x] Did you create an Apache Jira ticket? — [THRIFT-5983](https://issues.apache.org/jira/browse/THRIFT-5983) - [x] PR title follows the pattern "THRIFT-NNNN: describe my issue" - [x] Squashed to a single commit - [x] No breaking changes (internal refactor, public API preserved) Generated-by: Claude Opus 4.7 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
