Skip to content

Conversation

@W0rma
Copy link
Contributor

@W0rma W0rma commented Jul 31, 2025

As of PHP 8.1.0, calling this method has no effect; all methods are invokable by default.

(https://www.php.net/manual/en/reflectionmethod.setaccessible.php and https://www.php.net/manual/en/reflectionproperty.setaccessible.php).

There're even plans to deprecate the method in PHP 8.5: https://wiki.php.net/rfc/deprecations_php_8_5#extreflection_deprecations

This PR drops support for PHP < 8.1.
Thus, the calls can be safely removed.

@W0rma
Copy link
Contributor Author

W0rma commented Jul 31, 2025

CI failure will be fixed in #52

@SamMousa
Copy link
Contributor

@W0rma you should have an update button here (because I merged #52), alternatively please merge in master so the CI stops failing please!

@W0rma W0rma force-pushed the reflection-set-accessible branch from 3dcb2ed to 5ac8021 Compare July 31, 2025 09:52
@W0rma
Copy link
Contributor Author

W0rma commented Jul 31, 2025

@SamMousa Rebase done - thank you!

@SamMousa
Copy link
Contributor

I cannot casually merge a PHP version bump though... So this will require a major release.
And personally I'd argue that if we do one, we should be dropping all old versions of PHP, so everything < 8.4.

@W0rma
Copy link
Contributor Author

W0rma commented Jul 31, 2025

So this will require a major release.

I noticed that for Codeception itself a PHP version bump was done in a minor release ( https://github.com/Codeception/Codeception/releases/tag/5.3.0 ).
I'm okay with this approach because IMO bumping a PHP version does not break existing code - apps using a lower PHP version will just not be able to install the latest package version.

But I'm okay if you prefer to not bump the PHP version in a minor/patch release.

I could rework this PR to only call setAccessable() if PHP < 8.1 is used. WDYT?

@SamMousa
Copy link
Contributor

I noticed that for Codeception itself a PHP version bump was done in a minor release

Fair enough, a minor release it is then! We don't have a very big group (or well organised group) of maintainers.

I'll merge this, then I'll try and figure out how we do releases for this repo.

@SamMousa SamMousa merged commit ea95ca0 into Codeception:master Jul 31, 2025
4 checks passed
@W0rma W0rma deleted the reflection-set-accessible branch July 31, 2025 11:19
@Codeception Codeception deleted a comment from github-actions bot Aug 1, 2025
@github-actions
Copy link

github-actions bot commented Aug 1, 2025

🎉 This PR is included in version 4.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants