12 use ReflectionProperty;
15 require_once(dirname(dirname(dirname(__DIR__))) .
"/vendor/autoload.php");
20 public static function invokeObjectsMethodnameWith($object, $fun, array $args=array())
22 $reflection =
new ReflectionClass($object);
24 $method = $reflection->getMethod($fun);
25 $method->setAccessible(
true);
26 return $method->invokeArgs($object,$args);
29 public static function getObjectsProperty($object, $prop)
31 $reflection =
new ReflectionClass($object);
33 $property = $reflection->getProperty($prop);
34 $property->setAccessible(
true);
35 return $property->getValue($object);
38 public static function setObjectsProperty($object, $prop, $value)
40 $reflection =
new ReflectionClass($object);
42 $property = $reflection->getProperty($prop);
43 $property->setAccessible(
true);
44 $property->setValue($object, $value);