Extract components and add more tests
This commit is contained in:
@@ -13,4 +13,12 @@ trait PropertyInspector
|
||||
$property->setAccessible(true);
|
||||
return $property->getValue($object);
|
||||
}
|
||||
|
||||
protected function setProperty(object $object, string $propertyName, $value): void
|
||||
{
|
||||
$reflector = new ReflectionObject($object);
|
||||
$property = $reflector->getProperty($propertyName);
|
||||
$property->setAccessible(true);
|
||||
$property->setValue($object, $value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user