You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by "Volodymyr Panivko (Jira)" <ji...@apache.org> on 2026/09/21 18:04:00 UTC

[jira] [Updated] (THRIFT-6335) Replace PHP ReflectionHelper with direct reflection

     [ https://issues.apache.org/jira/browse/THRIFT-6335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Volodymyr Panivko updated THRIFT-6335:
--------------------------------------
    Description: 
PHP 8.1 is already the minimum supported version. ReflectionProperty and ReflectionMethod can access non-public members on supported runtimes without setAccessible calls, making the ReflectionHelper test trait unnecessary.

Replace the helper calls in all 19 affected test classes with direct ReflectionProperty and ReflectionMethod operations. Remove the trait imports and delete lib/php/test/Unit/Lib/ReflectionHelper.php. Preserve the existing assertions and test setup, including inherited-property access and static cache resets. The minimum PHP version remains 8.1.

Validation:
* PHP unit suite on PHP 8.4.21: 739 tests, 2,400 assertions, 5 skipped, no failures.
* PHP 8.1.34: all 19 changed test classes pass syntax checks; a smoke test verifies direct private, inherited, and static property access and private-method invocation.
* PHP_CodeSniffer for all modified test classes and git diff --check pass.
* No remaining helper references or explicit distribution entries require updating.
* Full make style is blocked by unavailable clang-format and a configured Swift build referencing a missing Makefile.am.

Pull request: https://github.com/apache/thrift/pull/3927

Generated-by: OpenAI Codex (GPT-6)


  was:
The PHP test ReflectionHelper still checks PHP_VERSION_ID < 80100 before calling ReflectionMethod::setAccessible(true) and ReflectionProperty::setAccessible(true). The project already requires PHP 8.1, so neither branch executes on supported runtimes.

Remove both obsolete branches, simplify the reflection accessors, and update their descriptions. Keep the helper methods used by the existing tests. The minimum PHP version remains 8.1.

Validation should cover private-property reads/writes and private-method invocation on PHP 8.1, the existing PHP unit tests, and the PHP coding standard.

Generated-by: OpenAI Codex (GPT-6)


        Summary: Replace PHP ReflectionHelper with direct reflection  (was: Remove obsolete PHP version checks from ReflectionHelper)

> Replace PHP ReflectionHelper with direct reflection
> ---------------------------------------------------
>
>                 Key: THRIFT-6335
>                 URL: https://issues.apache.org/jira/browse/THRIFT-6335
>             Project: Thrift
>          Issue Type: Task
>          Components: PHP - Library
>            Reporter: Volodymyr Panivko
>            Assignee: Volodymyr Panivko
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> PHP 8.1 is already the minimum supported version. ReflectionProperty and ReflectionMethod can access non-public members on supported runtimes without setAccessible calls, making the ReflectionHelper test trait unnecessary.
> Replace the helper calls in all 19 affected test classes with direct ReflectionProperty and ReflectionMethod operations. Remove the trait imports and delete lib/php/test/Unit/Lib/ReflectionHelper.php. Preserve the existing assertions and test setup, including inherited-property access and static cache resets. The minimum PHP version remains 8.1.
> Validation:
> * PHP unit suite on PHP 8.4.21: 739 tests, 2,400 assertions, 5 skipped, no failures.
> * PHP 8.1.34: all 19 changed test classes pass syntax checks; a smoke test verifies direct private, inherited, and static property access and private-method invocation.
> * PHP_CodeSniffer for all modified test classes and git diff --check pass.
> * No remaining helper references or explicit distribution entries require updating.
> * Full make style is blocked by unavailable clang-format and a configured Swift build referencing a missing Makefile.am.
> Pull request: https://github.com/apache/thrift/pull/3927
> Generated-by: OpenAI Codex (GPT-6)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)