PhpSourceTokenVisitor
class PhpSourceTokenVisitor implements Iterator, Countable (View source)
PHP source token visitor.
Constants
| EVENT_SCOPE_START |
Traverser event Raised when a opening curly-bracket ("{") is encountered |
| EVENT_SCOPE_END |
Traverser event Raised when a closing curly bracket ("}") is encountered or a semi-colon (";") delimiting a block or an element declaration. |
Methods
setStartIndex($offset)
No description
setEndIndex($offset)
No description
setIndexRange($s, $e)
No description
traverse(callable $callable = null)
No description
count()
No description
next()
No description
valid()
No description
current()
No description
rewind()
No description
key()
No description
setScopeEventHandler(callable $callable = null)
Register a callable that will receive scope events while traversing tokens
getCurrentScope()
Get current scope
static integer
skipWhitespace($tokens, $index, $count = -1)
No description
static string
Details
at line 46
__construct(string|ArrayObject|Traversable $codeOrArray)
at line 64
setStartIndex($offset)
at line 71
setEndIndex($offset)
at line 78
setIndexRange($s, $e)
at line 94
traverse(callable $callable = null)
at line 119
count()
at line 125
next()
at line 139
valid()
at line 149
current()
at line 155
rewind()
at line 165
key()
at line 177
setScopeEventHandler(callable $callable = null)
Register a callable that will receive scope events while traversing tokens
at line 190
PhpSourceTokenScope
getCurrentScope()
Get current scope