Implement Unit Tests, add Readme, add examples, stronger implementation
This commit is contained in:
16
src/Tests/Tools/PropertyInspector.php
Normal file
16
src/Tests/Tools/PropertyInspector.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Toalett\Multiprocessing\Tests\Tools;
|
||||
|
||||
use ReflectionObject;
|
||||
|
||||
trait PropertyInspector
|
||||
{
|
||||
protected function getProperty(object $object, string $propertyName)
|
||||
{
|
||||
$reflector = new ReflectionObject($object);
|
||||
$property = $reflector->getProperty($propertyName);
|
||||
$property->setAccessible(true);
|
||||
return $property->getValue($object);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user