浏览代码

fix RelctionClass declaration

Vincent GUFFON 4 年之前
父节点
当前提交
e87b5e8b28
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/Service/Utils/Reflection.php

+ 3 - 1
src/Service/Utils/Reflection.php

@@ -20,14 +20,16 @@ class Reflection
     }
     }
 
 
     /**
     /**
+     * Appel une fonction avec ses paramètres d'une classe
      * @param string $serviceName
      * @param string $serviceName
      * @param string $method
      * @param string $method
      * @param array $parameters
      * @param array $parameters
      * @return mixed
      * @return mixed
+     * @throws \ReflectionException
      */
      */
     public function dynamicInvokeWithArgsServiceMethod(string $serviceName, string $method, array $parameters = []) {
     public function dynamicInvokeWithArgsServiceMethod(string $serviceName, string $method, array $parameters = []) {
         $function = $this->container->get($serviceName);
         $function = $this->container->get($serviceName);
-        $reflection = \ReflectionClass(get_class($function));
+        $reflection = new \ReflectionClass(get_class($function));
         $method = $reflection->getMethod($method);
         $method = $reflection->getMethod($method);
         return $method->invokeArgs($function, $parameters);
         return $method->invokeArgs($function, $parameters);
     }
     }