sveneld opened a new pull request, #3332: URL: https://github.com/apache/thrift/pull/3332
## Summary Implements UUID as a first-class type in the PHP library and code generator, as part of [THRIFT-5587](https://issues.apache.org/jira/browse/THRIFT-5587). - UUID is represented as a canonical string (`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`) in PHP, similar to the Python implementation - Wire format: fixed 16 bytes in big-endian order (binary and compact protocols) - JSON protocol: UUID serialized as a JSON string in canonical form ### Changes **PHP Library:** - `TType::UUID = 16` constant - `writeUuid()`/`readUuid()` in TBinaryProtocol, TCompactProtocol, TJSONProtocol, TSimpleJSONProtocol, TProtocolDecorator - UUID skip support in TProtocol (`skip()` and `skipBinary()`) - Compact protocol type mapping (`COMPACT_UUID = 0x0D`) - TBase `$tmethod` mapping for automatic read/write dispatch **Code Generator (`t_php_generator.cc`):** - `TYPE_UUID` cases in all switch statements: `type_to_enum`, `type_to_cast`, `type_to_phpdoc`, `render_const_value`, `generate_serialize_field` (protocol + binary inline), `generate_deserialize_field` (protocol + binary inline) **Tests:** - Unit tests for UUID read/write in TBinaryProtocol and TCompactProtocol - Cross-test handler (`testUuid`) and client test cases - Updated test Makefiles and ThriftTest.thrift references to use the current version (with UUID fields) ## Test plan - [x] PHP unit tests pass (196/196 protocol tests, 0 failures) - [x] Thrift compiler builds and generates correct PHP UUID code (`TType::UUID`, `readUuid`, `writeUuid`) - [x] Generated `ThriftTest_testUuid_args.php` and `ThriftTest_testUuid_result.php` contain correct UUID serialization - [x] Verified on ubuntu-noble (PHP 8.3) Docker environment -- 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]
