public function Twig_Extension_Core::parseTestExpression in Translation template extractor 6.3
Same name and namespace in other branches
- 7.3 vendor/Twig/Extension/Core.php \Twig_Extension_Core::parseTestExpression()
1 call to Twig_Extension_Core::parseTestExpression()
- Twig_Extension_Core::parseNotTestExpression in vendor/
Twig/ Extension/ Core.php
File
- vendor/
Twig/ Extension/ Core.php, line 298
Class
Code
public function parseTestExpression(Twig_Parser $parser, Twig_NodeInterface $node) {
$stream = $parser
->getStream();
$name = $this
->getTestName($parser, $node
->getLine());
$class = $this
->getTestNodeClass($parser, $name);
$arguments = null;
if ($stream
->test(Twig_Token::PUNCTUATION_TYPE, '(')) {
$arguments = $parser
->getExpressionParser()
->parseArguments(true);
}
return new $class($node, $name, $arguments, $parser
->getCurrentToken()
->getLine());
}