Fix Deprecated ArrayObject::__construct() and Method ReflectionMethod::setAccessible() in PHP 8.5.#548
Open
terabytesoftw wants to merge 5 commits intoyiisoft:masterfrom
Open
Fix Deprecated ArrayObject::__construct() and Method ReflectionMethod::setAccessible() in PHP 8.5.#548terabytesoftw wants to merge 5 commits intoyiisoft:masterfrom
ArrayObject::__construct() and Method ReflectionMethod::setAccessible() in PHP 8.5.#548terabytesoftw wants to merge 5 commits intoyiisoft:masterfrom
Conversation
Member
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.
s1lver
approved these changes
Feb 9, 2026
mspirkov
reviewed
Feb 9, 2026
mspirkov
approved these changes
Feb 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.