Volodymyr Panivko created THRIFT-5983:
-----------------------------------------
Summary: Replace switch with match expression in PHP
TProtocol::skip and skipBinary
Key: THRIFT-5983
URL: https://issues.apache.org/jira/browse/THRIFT-5983
Project: Thrift
Issue Type: Improvement
Components: PHP - Library
Reporter: Volodymyr Panivko
Refactor PHP runtime `lib/php/lib/Protocol/TProtocol.php`:
- Convert `switch ($type)` in `skip()` to `match` expression
- Convert `switch ($type)` in `skipBinary()` to `match` expression
Match expressions enforce exhaustive case handling (no fall-through bugs), use
strict comparison (===), and naturally throw `UnhandledMatchError` on unknown
values — but here we keep an explicit `TProtocolException` to preserve the
existing API contract.
This is a follow-up to THRIFT-5981 within the umbrella THRIFT-5960 (PHP
modernization).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)