Inheritance: extends ReflectionFunctio\ReflectionFunction
Ejemplo n.º 1
0
 public function testClosureStaticFail()
 {
     $f = static function () {
     };
     $rc = new ReflectionClosure($f);
     $this->assertFalse($rc->isStatic());
 }
Ejemplo n.º 2
0
 /**
  * Analyzer a given closure.
  *
  * @param Closure $closure
  *
  * @return array
  */
 public function analyze(Closure $closure)
 {
     $reflection = new ReflectionClosure($closure);
     $scope = $reflection->getClosureScopeClass();
     $data = ['reflection' => $reflection, 'code' => $reflection->getCode(), 'hasThis' => $reflection->isBindingRequired(), 'context' => $reflection->getUseVariables(), 'hasRefs' => false, 'binding' => $reflection->getClosureThis(), 'scope' => $scope ? $scope->getName() : null, 'isStatic' => $reflection->isStatic()];
     return $data;
 }