sveneld opened a new pull request, #3459:
URL: https://github.com/apache/thrift/pull/3459

   Migrates the public methods on `lib/php/lib/Server/` and 
`lib/php/lib/Factory/` from PHPDoc `@param`/`@return` annotations to native 
parameter and return types. The Server abstractions and the protocol/transport 
factories are isolated subtrees — they reference `TTransport`/`TProtocol` only 
via composition, so adding native types here does not cascade out to the 
Transport or Protocol hierarchies (separate sub-tickets).
   
   ## Server
   
   - `TServer::serve()` / `stop()` typed `void`.
   - `TSimpleServer` / `TForkingServer` match the new abstract signatures.
   - `TForkingServer`'s protected helpers (`handleParent`, `handleChild`, 
`collectChildren`) typed.
   - `TServerTransport::listen()` / `close()` / `acceptImpl()` / `accept()` 
typed; `accept()` now returns `TTransport` (it was already that semantically — 
it throws on null), `acceptImpl()` returns `?TTransport`.
   - `TServerSocket` overrides typed; `acceptImpl()` returns `?TSocket`.
   - `TSSLServerSocket::listen()` typed; `acceptImpl()` returns `?TSSLSocket`.
   
   ## Factory
   
   - `TProtocolFactory` interface typed: `getProtocol(TTransport): TProtocol`.
   - `TBinaryProtocolFactory` / `TCompactProtocolFactory` / 
`TJSONProtocolFactory` match with covariant concrete return types.
   - `TTransportFactoryInterface` typed: `getTransport(TTransport): TTransport`.
   - `TTransportFactory` / `TFramedTransportFactory` match with covariant 
return types where appropriate.
   
   ## Test fixtures (latent issues surfaced by typed signatures)
   
   - `ServerStub::serve`/`stop` now typed `void`.
   - `ServerTransportStub` uses constructor property promotion with 
`?TTransport` and matches abstract `acceptImpl(): ?TTransport`.
   - `TSimpleServerTest` had stubs of the wrong class for the factories 
(`TServerTransport` where `TTransport`/`TProtocol` was expected); fixed.
   - `TForkingServerTest` mocks had `accept()` returning `null` to simulate "no 
connection", which violated the now-typed `TTransport` return. Replaced with 
throwing `TTransportException`, which is what real `accept()` does on null and 
what the `serve()` loop already catches.
   
   Part of [THRIFT-5960](https://issues.apache.org/jira/browse/THRIFT-5960) — 
modernizing PHP runtime library typing. Builds on the property typing 
(THRIFT-5976), constructor promotion (THRIFT-5977), and 
`declare(strict_types=1)` (THRIFT-5978).
   
   - [x] Did you create an [Apache 
Jira](https://issues.apache.org/jira/projects/THRIFT/issues/) ticket? — 
[THRIFT-5979](https://issues.apache.org/jira/browse/THRIFT-5979)
   - [x] If a ticket exists: Does your pull request title follow the pattern 
"THRIFT-NNNN: describe my issue"? — yes
   - [x] Did you squash your changes to a single commit? — yes
   - [x] Did you do your best to avoid breaking changes? — yes; signatures are 
typed exactly where Server/Factory subtrees terminate, no public-API removal, 
covariant return narrowings only.
   - [ ] If your change does not involve any code, include `[skip ci]` anywhere 
in the commit message to free up build resources. — N/A (code change)
   
   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]

Reply via email to