mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
fix: deprecated code in PHP 8.3
Calling ReflectionProperty::setValue() with a 1st argument which is not null or an object is deprecated
This commit is contained in:
parent
ec8ba91c69
commit
436457338c
@ -74,7 +74,12 @@ trait ReflectionHelper
|
||||
public static function setPrivateProperty($obj, $property, $value)
|
||||
{
|
||||
$refProperty = self::getAccessibleRefProperty($obj, $property);
|
||||
$refProperty->setValue($obj, $value);
|
||||
|
||||
if (is_object($obj)) {
|
||||
$refProperty->setValue($obj, $value);
|
||||
} else {
|
||||
$refProperty->setValue(null, $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user