Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
b2efdf5 to
eedd912
Compare
eedd912 to
0e4deb0
Compare
|
Size Change: 0 B Total Size: 2.12 MB ℹ️ View Unchanged
|
0e4deb0 to
42fd1e6
Compare
42fd1e6 to
e466f66
Compare
e466f66 to
3efaeda
Compare
3efaeda to
ccc4766
Compare
ccc4766 to
d7cd6e9
Compare
d7cd6e9 to
eb4dffa
Compare
eb4dffa to
c232372
Compare
c232372 to
a53d096
Compare
a53d096 to
843bfc2
Compare
Part of #82785.
What?
Guard every remaining unguarded
ReflectionMethod::setAccessible()/ReflectionProperty::setAccessible()call in the PHPUnit test suite withif ( PHP_VERSION_ID < 80100 ), in:phpunit/class-wp-theme-json-resolver-test.php(5 occurrences)phpunit/blocks/class-wp-navigation-block-renderer-test.php(5 occurrences)phpunit/class-wp-theme-json-test.php(8 occurrences)phpunit/class-wp-duotone-test.php(4 occurrences)phpunit/blocks/render-block-rss-test.php(1 occurrence)23 occurrences total.
Why?
PHP 8.5 deprecates
ReflectionMethod::setAccessible()andReflectionProperty::setAccessible()— they've had no effect since PHP 8.1, since reflection can access private/protected members without the call from that version onward. This project's PHPUnit configuration turns deprecation notices into test errors, so the PHP 8.5 leg added by #82874, directly below, fails every test that makes one of these calls, with:The call is still genuinely required on PHP < 8.1, which
gutenberg.phpcontinues to support down to PHP 7.4 — reflection cannot access a private/protected member on those versions without it. Version-gating withPHP_VERSION_ID < 80100is therefore the correct fix for both ends of the supported PHP range, not a workaround: it keeps the call in effect where it's needed and silences the deprecation everywhere it's redundant.Trunk hit and fixed the identical issue in commit 3fded09 (WordPress/gutenberg#79260, "CI: Run PHP unit tests on PHP 8.4 and 8.5"), landed 2026-06-17 — well after
wp/6.9branched, so it never made it back here on its own.How?
This PR ports trunk's fix, cherry-pick style, adapted to
wp/6.9's current line numbers (which have drifted from trunk's). The wrapping pattern is identical to trunk's:One difference from a literal cherry-pick: trunk's diff for commit 3fded09 only shows 2 of
class-wp-duotone-test.php's 4setAccessible()occurrences, since the other 2 had already been guarded by an earlier, separate trunk commit beforewp/6.9branched off. Onwp/6.9, all 4 were still unguarded, so all 4 are guarded here.No other content in these files was changed.
Use of AI Tools
This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.