\SuperClosure\AnalyzerTokenAnalyzer

This is the token based analyzer.

We're using Uses reflection and tokenization to analyze a closure and determine its code and context. This is much faster than the AST based implementation.

Summary

Methods
Properties
Constants
analyze()
determineCode()
No public properties found
No constants found
determineContext()
No protected properties found
N/A
determineBinding()
isClosureStatic()
determineTokens()
determinePotentialTokens()
No private properties found
N/A

Methods

analyze()

analyze(\Closure  $closure) : array

Analyzer a given closure.

Parameters

\Closure $closure

Throws

\SuperClosure\Exception\ClosureAnalysisException

Returns

array

determineCode()

determineCode(array  $data) 

Parameters

array $data

determineContext()

determineContext(array  $data) 

Returns the variables that are in the "use" clause of the closure.

These variables are referred to as the "used variables", "static variables", "closed upon variables", or "context" of the closure.

Parameters

array $data

determineBinding()

determineBinding(array  $data) 

Parameters

array $data

isClosureStatic()

isClosureStatic(\Closure  $closure) 

Parameters

\Closure $closure

determineTokens()

determineTokens(array  $data) 

Parameters

array $data

determinePotentialTokens()

determinePotentialTokens(\ReflectionFunction  $reflection) 

Parameters

\ReflectionFunction $reflection