$tokens
$tokens :
Represents a token stream.
__construct(array $tokens, \Twig_Source $source = null)
| array | $tokens | An array of tokens |
| \Twig_Source | $source |
next() : \Twig_Token
Sets the pointer to the next token and returns the old one.
nextIf( $primary, $secondary = null) : \Twig_Token|null
Tests a token, sets the pointer to the next one and returns it or throws a syntax error.
| $primary | ||
| $secondary |
The next token if the condition is true, null otherwise
expect( $type, $value = null, $message = null) : \Twig_Token
Tests a token and returns it or throws a syntax error.
| $type | ||
| $value | ||
| $message |
look(integer $number = 1) : \Twig_Token
Looks at the next token.
| integer | $number |
getCurrent() : \Twig_Token