Skip to content

Fix Deprecated ArrayObject::__construct() and Method ReflectionMethod::setAccessible() in PHP 8.5.#548

Open
terabytesoftw wants to merge 5 commits intoyiisoft:masterfrom
terabytesoftw:fix_php85_1
Open

Fix Deprecated ArrayObject::__construct() and Method ReflectionMethod::setAccessible() in PHP 8.5.#548
terabytesoftw wants to merge 5 commits intoyiisoft:masterfrom
terabytesoftw:fix_php85_1

Conversation

@terabytesoftw
Copy link
Member

Q A
Is bugfix? ✔️
New feature?
Breaks BC?
Tests pass?

@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 18.36%. Comparing base (151c18c) to head (37d0cca).
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@terabytesoftw terabytesoftw requested a review from a team February 9, 2026 08:08
@terabytesoftw terabytesoftw added the status:code review The pull request needs review. label Feb 9, 2026
@terabytesoftw terabytesoftw requested a review from Copilot February 9, 2026 08:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ArrayObject construction from __PHP_Incomplete_Class objects with an array-based approach.
  • Update phpstan-baseline.neon entries 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.

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

Labels

status:code review The pull request needs review. type:bug Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants