Exemple #1
0
 /**
  * Invoke.
  *
  * @acccess  protected
  * @param    \Hoa\Core\Consistency\Xcallable    &$reflection       Callable.
  * @param    \ReflectionFunctionAbstract        &$reflection       Reflection.
  * @param    array                              &$arguments        Arguments.
  * @param    bool                                $isConstructor    Whether
  *                                                                 it is a
  *                                                                 constructor.
  * @return   mixed
  * @throws   \Exception
  */
 protected function invoke(Core\Consistency\Xcallable &$callable, \ReflectionFunctionAbstract &$reflection, array &$arguments, $isConstructor)
 {
     if ($reflection instanceof \ReflectionFunction) {
         return $reflection->invokeArgs($arguments);
     }
     if (false === $isConstructor) {
         $_callback = $callable->getValidCallback();
         $_object = $_callback[0];
         return $reflection->invokeArgs($_object, $arguments);
     }
     $class = $reflection->getDeclaringClass();
     $instance = $class->newInstanceArgs($arguments);
     $callable = xcallable($instance, '__construct');
     $reflection = $callable->getReflection();
     return void;
 }