Opis\Closure\Analyzer::analyze PHP Method

analyze() public method

Analyzer a given closure.
public analyze ( Closure $closure ) : array
$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;
    }