function TokenStream::next
Sets the pointer to the next token and returns the old one.
2 calls to TokenStream::next()
- TokenStream::expect in vendor/
twig/ twig/ src/ TokenStream.php - Tests a token and returns it or throws a syntax error.
- TokenStream::nextIf in vendor/
twig/ twig/ src/ TokenStream.php - Tests a token, sets the pointer to the next one and returns it or throws a syntax error.
File
-
vendor/
twig/ twig/ src/ TokenStream.php, line 50
Class
- TokenStream
- Represents a token stream.
Namespace
TwigCode
public function next() : Token {
if (!isset($this->tokens[++$this->current])) {
throw new SyntaxError('Unexpected end of template.', $this->tokens[$this->current - 1]
->getLine(), $this->source);
}
return $this->tokens[$this->current - 1];
}