-
Couldn't load subscription status.
- Fork 43
PHP 8.5 | CallRerouting: prevent deprecation notice for Reflection*::setAccessible() #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…setAccessible() Since PHP 8.1, calling the `Reflection*::setAccessible()` methods is no longer necessary as reflected properties/methods/etc will always be accessible. However, the method calls are still needed for PHP < 8.1. As of PHP 8.5, calling the `Reflection*::setAccessible()` methods is now formally deprecated and will yield a deprecation notice, which will fail test runs. As of PHP 9.0, the `setAccessible()` method(s) will be removed. With the latter in mind, this commit prevents the deprecation notice by making the calls to `setAccessible()` conditional. Silencing the deprecation would mean, this would need to be "fixed" again come PHP 9.0, while the current solution should be stable, including for PHP 9.0. Ref: https://wiki.php.net/rfc/deprecations_php_8_5#extreflection_deprecations
00e20e4 to
5f0c012
Compare
|
@antecedent No rush, but it might be a good idea to get this fix released sooner rather than later as the deprecation notice may block other projects from testing their PHP 8.5 readiness... |
|
Having said that, not all PHP 8.5 deprecation have been merged yet, so there may be more fixes needed soon enough. Then again, no harm in having some small incremental releases to get through them all. |
|
Makes sense. I'll push a new tag in a bit. |
|
The GH Action for running tests fails with PHP 7.3 and 8.5 now. The 7.3 thing seems completely accidental and has happened before. It fails at the Setup PHP step; rerunning the Action "fixes" this. The 8.5 thing, on the other hand, seems to be due to something depending on an outdated version of |
|
@antecedent Ah, yes, the Let me pull a quick work-around, which should allow the tests to run on PHP 8.5 again. Once Promise + Composer have released new versions, that work-around can be reverted again. |
|
@antecedent See PR #177 |
|
@jrfnl This is great, thanks! I moved the 2.2.2 release out of draft status. |
|
Thanks @antecedent ! |
Since PHP 8.1, calling the
Reflection*::setAccessible()methods is no longer necessary as reflected properties/methods/etc will always be accessible. However, the method calls are still needed for PHP < 8.1.As of PHP 8.5, calling the
Reflection*::setAccessible()methods is now formally deprecated and will yield a deprecation notice, which will fail test runs. As of PHP 9.0, thesetAccessible()method(s) will be removed.With the latter in mind, this commit prevents the deprecation notice by making the calls to
setAccessible()conditional.Silencing the deprecation would mean, this would need to be "fixed" again come PHP 9.0, while the current solution should be stable, including for PHP 9.0.
Ref: https://wiki.php.net/rfc/deprecations_php_8_5#extreflection_deprecations