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 |
There was a problem hiding this comment.
🟢 Approval recommended
All affected calls use the correct PHP 8.1 boundary without changing test behavior on supported versions.
Pull request overview
Guards reflection accessibility calls for PHP 8.1+, preventing PHP 8.5 deprecation failures while retaining PHP 7.4–8.0 compatibility.
Changes:
- Wraps all 23
setAccessible()calls with PHP version checks. - Preserves legacy reflection access behavior below PHP 8.1.
File summaries
| File | Description |
|---|---|
phpunit/class-wp-theme-json-test.php |
Guards eight reflection calls. |
phpunit/class-wp-theme-json-resolver-test.php |
Guards five reflection calls. |
phpunit/class-wp-duotone-test.php |
Guards four reflection calls. |
phpunit/blocks/render-block-rss-test.php |
Guards one reflection call. |
phpunit/blocks/class-wp-navigation-block-renderer-test.php |
Guards five reflection calls. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
cebe1e2 to
d14009f
Compare
d14009f to
ec8e601
Compare
ec8e601 to
d6a1979
Compare
d6a1979 to
21910cc
Compare
21910cc to
d24665f
Compare
d24665f to
764f124
Compare
764f124 to
83930ae
Compare
|
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. |
83930ae to
3dab084
Compare
55f76b0 to
df75cca
Compare
df75cca to
043db36
Compare
043db36 to
a5c7388
Compare
a5c7388 to
7cd57aa
Compare
wp/7.0 branch Actions: Guard setAccessible() calls for PHP 8.5
7cd57aa to
d3a4e1e
Compare
d3a4e1e to
9c38893
Compare
Part of #82782.
What?
Guards every remaining unguarded
ReflectionMethod::setAccessible()/ReflectionProperty::setAccessible()call in this branch's PHPUnit tests withif ( PHP_VERSION_ID < 80100 ), across 5 files and 23 call sites:phpunit/class-wp-theme-json-resolver-test.phpphpunit/blocks/class-wp-navigation-block-renderer-test.phpphpunit/class-wp-theme-json-test.phpphpunit/class-wp-duotone-test.phpphpunit/blocks/render-block-rss-test.phpWhy?
PHP 8.5 deprecates
ReflectionMethod::setAccessible()/ReflectionProperty::setAccessible()— they have had no effect since PHP 8.1, since reflection can already access private/protected members without the call from 8.1 onward. This branch's PHPUnit config turns deprecation notices into test errors, so the PHP 8.5 leg added by #82809, directly below, fails every test that makes one of these calls, with errors like:The guard is required in both directions: PHP 8.5+ deprecates the call outright, but PHP < 8.1 (still supported — this branch's
gutenberg.phprequires PHP >= 7.4) genuinely cannot access private/protected members via reflection without it.if ( PHP_VERSION_ID < 80100 )is the only way to satisfy both ends of the supported PHP range.How?
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 — after
wp/7.0branched, so it never made it back towp/7.0. This PR ports that same guard pattern towp/7.0's own copies of these files, adapted to this branch's own line numbers/content (which have drifted somewhat from trunk's current state). Unlike trunk's diff, all 4setAccessible()calls inclass-wp-duotone-test.phpneeded the guard here (trunk's diff only shows 2, since the other 2 had already been guarded earlier in trunk's own history by a separate, unrelated commit that never landed on this branch).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.