sveneld opened a new pull request, #3455: URL: https://github.com/apache/thrift/pull/3455
## Summary Convert PHPDoc \`@var\` annotations on properties throughout \`lib/php/lib/\` to native PHP typed properties. This is a no-LSP-cascade additive change — typed properties don't impose covariance constraints on subclasses beyond the obvious requirement that any redeclaration use the same type. JIRA: https://issues.apache.org/jira/browse/THRIFT-5976 (sub-task of [THRIFT-5960](https://issues.apache.org/jira/browse/THRIFT-5960)). ## Scope * 31 files touched across \`Base\`, \`ClassLoader\`, \`Exception\`, \`Factory\`, \`Protocol\` (incl. \`JSON\`/\`SimpleJSON\`), \`Server\`, \`Transport\`, \`StoredMessageProtocol\`, \`TMultiplexedProcessor\`. * Properties typed are \`bool\`/\`int\`/\`string\`/\`float\`/\`array\`/\`object\` plus class types (\`TTransport\`, \`TProtocol\`, \`TServerTransport\`, etc.). * \`@var resource|null\` PHPDoc kept on socket/stream handles (PHP has no native \`resource\` type). * Static \`\$tmethod\` / \`\$tspec\` arrays declared as \`static array\`. ## Notable design notes * \`TJSONProtocol\` / \`TSimpleJSONProtocol\` context-class \`\$protocol\` props typed as \`object\` (rather than the concrete protocol class) so existing test stubs that don't extend the protocol class continue to work. * \`TCompactProtocol::\$lastFid\` is \`?int\` because \`writeBool\`'s special path flows null through \`writeFieldHeader\`. * \`TCurlClient::\$response\` typed \`string|false|null\` to reflect \`curl_exec\`'s \`string|false\` return alongside the null-initialized state. * \`TSocketPool::__construct\` passes \`''\` instead of \`null\` to parent \`TSocket::__construct\` since \`TSocket::\$host\` became typed \`string\`. * \`TPhpStream::\$inStream\`/\`\$outStream\` and \`TSocket::\$handle\` remain untyped (PHP \`resource\`). * \`timeout\` / \`connectionTimeout\` props on \`TCurlClient\` / \`THttpClient\` kept untyped (PHPDoc only) — typing them \`?float\` would cascade test data-provider updates (int → float coercion changes \`assertSame\` behavior); deferred to a follow-up sub-ticket. ## Verification Inside an Ubuntu 24.04 + ondrej/php container (PHP 8.4 + composer 2 + phpstan 1.12 + phpunit 13): \`\`\` composer phpstan OK (level 1, baseline unchanged) vendor/bin/phpcs OK phpunit Unit suite 629 tests, 1907 assertions, 0 errors phpunit Integration 106 tests, 166 assertions, 0 errors \`\`\` ## Checklist - [x] Did you create an [Apache Jira](https://issues.apache.org/jira/projects/THRIFT/issues/) ticket? — THRIFT-5976 - [x] If a ticket exists: Does your pull request title follow the pattern \"THRIFT-NNNN: describe my issue\"? - [x] Did you squash your changes to a single commit? - [x] Did you do your best to avoid breaking changes? — yes; native typed properties are inherited and tighten what was already documented in PHPDoc. Edge cases (timeout floats, resource-typed handles, mock-friendly contexts) preserved as documented. - [ ] If your change does not involve any code, include \`[skip ci]\` anywhere in the commit message to free up build resources. -- 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]
