src/Util/Closure/Serializer.php
private static 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;
    }
private static 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;
    }
private static 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 ; }
Analyzer a given closure.

@param \Closure $closure

@return array
Analyzer a given closure .