public function Twig_TokenStream::nextIf in Translation template extractor 7.2
Same name and namespace in other branches
- 6.3 vendor/Twig/TokenStream.php \Twig_TokenStream::nextIf()
- 7.3 vendor/Twig/TokenStream.php \Twig_TokenStream::nextIf()
Tests a token, sets the pointer to the next one and returns it or throws a syntax error.
Return value
Twig_Token|null The next token if the condition is true, null otherwise
File
- vendor/
Twig/ TokenStream.php, line 71
Class
- Twig_TokenStream
- Represents a token stream.
Code
public function nextIf($primary, $secondary = null) {
if ($this->tokens[$this->current]
->test($primary, $secondary)) {
return $this
->next();
}
}