getProperty($propertyName); $property->setAccessible(true); return $property; } /** * @param mixed $object * * @return mixed * * @throws ReflectionException */ public function invokeMethod($object, string $methodName, array $parameters = []) { $reflection = new ReflectionClass(get_class($object)); $method = $reflection->getMethod($methodName); $method->setAccessible(true); return $method->invokeArgs($object, $parameters); } }