[
https://issues.apache.org/jira/browse/THRIFT-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Volodymyr Panivko resolved THRIFT-5960.
---------------------------------------
Resolution: Fixed
> Adopt strict_types and native parameter / return / property types in
> lib/php/lib/
> ---------------------------------------------------------------------------------
>
> Key: THRIFT-5960
> URL: https://issues.apache.org/jira/browse/THRIFT-5960
> Project: Thrift
> Issue Type: New Feature
> Components: PHP - Library
> Affects Versions: 0.24.0
> Reporter: Volodymyr Panivko
> Assignee: Volodymyr Panivko
> Priority: Major
>
> After the PSR-12 sweep lands, the PHP runtime library still uses
> PHPDoc-only typing — zero native parameter types, zero return types,
> zero typed properties, no declare(strict_types=1).
> This ticket lands all three in one pass:
> * declare(strict_types=1) in every file under lib/php/lib/ and
> lib/php/test/.
> * Native parameter and return types for the public API: TTransport,
> TProtocol, TServer, TBase, TException, all Factory and Server
> classes, all Transport and Protocol implementations.
> * Typed properties wherever it is safe.
> * Constructor property promotion in pure-assignment Factory classes.
> * Native by-ref types in TProtocol abstract methods (PHP 8.1
> supports types on by-ref params).
> * Replace function_exists() runtime checks in TBinarySerializer,
> TSocket, TSocketPool with cached capability flags.
> * Selective switch -> match conversion in pure dispatchers; keep
> switch where there is fall-through.
> * After the sweep, raise phpstan level from 1 to a higher value (5
> or higher; to be decided based on what the new baseline looks
> like) and shrink the baseline accordingly.
> This is a breaking change for downstream code that subclasses public-
> API abstract bases (TTransport, TProtocol, TServer, TBase, TException).
> Plain users of the library are not affected. Generated structs that
> extend TBase continue to work because TBase::read/write retain loose
> TProtocol-typed parameters without array shape constraints.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)