function MacroTokenParser::checkConstantExpression
1 call to MacroTokenParser::checkConstantExpression()
- MacroTokenParser::parseDefinition in vendor/
twig/ twig/ src/ TokenParser/ MacroTokenParser.php
File
-
vendor/
twig/ twig/ src/ TokenParser/ MacroTokenParser.php, line 107
Class
- MacroTokenParser
- Defines a macro.
Namespace
Twig\TokenParserCode
private function checkConstantExpression(Node $node) : bool {
if (!($node instanceof ConstantExpression || $node instanceof ArrayExpression || $node instanceof NegUnary || $node instanceof PosUnary)) {
return false;
}
foreach ($node as $n) {
if (!$this->checkConstantExpression($n)) {
return false;
}
}
return true;
}