Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Yii Framework 2 debug extension Change Log
- Bug #541: Silence fetch errors (Karkbauer)
- Enh #546: Applying Yii2 coding standards (@s1lver)
- Enh #546: Raise min version to PHP 7.4 (@s1lver)
- Bug #548: Fix `Deprecated ArrayObject::__construct()` and Method `ReflectionMethod::setAccessible()` in PHP 8.5 (@terabytesoftw)
- Bug #549: Enhance documentation and add scripts for `composer.json` (@terabytesoftw)

2.1.27 June 08, 2025
Expand Down
4 changes: 2 additions & 2 deletions src/FlattenException.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ private function flattenArgs($args, $level = 0, &$count = 0)
*/
private function getClassNameFromIncomplete(\__PHP_Incomplete_Class $value)
{
$array = new \ArrayObject($value);
$array = \get_object_vars($value);

return $array['__PHP_Incomplete_Class_Name'];
return (string) ($array['__PHP_Incomplete_Class_Name'] ?? '');
}
}
6 changes: 5 additions & 1 deletion src/models/router/RouterRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ protected function scanRestRule($restRule)
{
$reflectionClass = new \ReflectionClass($restRule);
$reflectionProperty = $reflectionClass->getProperty('rules');
$reflectionProperty->setAccessible(true);

if (PHP_VERSION_ID < 80100) {
$reflectionProperty->setAccessible(true);
}

$rulesGroups = $reflectionProperty->getValue($restRule);

foreach ($rulesGroups as $rules) {
Expand Down
12 changes: 10 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,17 @@ protected function invoke($object, $method, array $args = [])
{
$classReflection = new \ReflectionClass(get_class($object));
$methodReflection = $classReflection->getMethod($method);
$methodReflection->setAccessible(true);

if (PHP_VERSION_ID < 80100) {
$methodReflection->setAccessible(true);
}

$result = $methodReflection->invokeArgs($object, $args);
$methodReflection->setAccessible(false);

if (PHP_VERSION_ID < 80100) {
$methodReflection->setAccessible(false);
}

return $result;
}
}