Skip to content

Commit 4364573

Browse files
committed
fix: deprecated code in PHP 8.3
Calling ReflectionProperty::setValue() with a 1st argument which is not null or an object is deprecated
1 parent ec8ba91 commit 4364573

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

system/Test/ReflectionHelper.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,12 @@ private static function getAccessibleRefProperty($obj, $property)
7474
public static function setPrivateProperty($obj, $property, $value)
7575
{
7676
$refProperty = self::getAccessibleRefProperty($obj, $property);
77-
$refProperty->setValue($obj, $value);
77+
78+
if (is_object($obj)) {
79+
$refProperty->setValue($obj, $value);
80+
} else {
81+
$refProperty->setValue(null, $value);
82+
}
7883
}
7984

8085
/**

0 commit comments

Comments
 (0)