public function testIsStaticMethodForInvokedObject()
 {
     $reflectedCallable = new CallableReflection($this->getInvokedObject());
     $this->assertFalse($reflectedCallable->isStaticMethod());
 }
Пример #2
0
Файл: Phi.php Проект: bapcat/phi
 /**
  * Executes a callable using dependency injection
  * 
  * @param  callable  $call       A callable to execute using dependency injection
  * @param  mixed[]   $arguments  The arguments to pass to the callable
  * 
  * @return mixed     The return value of the callable
  */
 public function call(callable $call, array $arguments = [])
 {
     $reflector = new CallableReflection($call);
     $method = $reflector->getReflector();
     $values = $this->buildArguments($method, $arguments);
     //TODO Workaround for PHP5...
     if ($reflector->isStaticMethod()) {
         return $reflector->invokeArgsStatic($values);
     }
     return $call(...$values);
 }