Fix Deprecated ArrayObject::__construct() and Method ReflectionMethod::setAccessible() in PHP 8.5.#548
Conversation
terabytesoftw
commented
Feb 9, 2026
| Q | A |
|---|---|
| Is bugfix? | ✔️ |
| New feature? | ❌ |
| Breaks BC? | ❌ |
| Tests pass? | ❌ |
…hod::setAccessible()` in PHP `8.5`.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #548 +/- ##
============================================
+ Coverage 18.34% 18.36% +0.02%
- Complexity 656 657 +1
============================================
Files 78 78
Lines 3495 3496 +1
============================================
+ Hits 641 642 +1
Misses 2854 2854 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Updates the Yii2 debug extension to avoid PHP 8.5 deprecation warnings around Reflection accessibility overrides and ArrayObject construction, while adjusting the PHPStan baseline accordingly.
Changes:
- Avoid calling deprecated
ReflectionMethod::setAccessible()in the PHPUnit helper used to invoke non-public methods. - Avoid calling deprecated
ReflectionProperty::setAccessible()when reflecting into REST URL rule internals. - Replace
ArrayObjectconstruction from__PHP_Incomplete_Classobjects with an array-based approach. - Update
phpstan-baseline.neonentries to match current analyzer output and remove obsolete suppressions.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/TestCase.php | Conditionalizes setAccessible() calls to avoid PHP 8.5 deprecations when invoking non-public methods in tests. |
| src/models/router/RouterRules.php | Conditionalizes ReflectionProperty::setAccessible() to avoid PHP 8.5 deprecations in REST rule scanning. |
| src/FlattenException.php | Avoids deprecated ArrayObject construction from incomplete-class objects by using get_object_vars(). |
| phpstan-baseline.neon | Refreshes PHPStan baseline entries (removals and message pattern updates). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@terabytesoftw @samdark Would you mind if I push another new release here? PHP 8.5 has been out for a while, and the Yii2 debug bar still throws errors. Installing |
|
I know it's pending, but we're reviewing all the packages to release them with full support. |