You are here

protected function Twig_ExpressionParser::checkConstantExpression in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/lib/Twig/ExpressionParser.php \Twig_ExpressionParser::checkConstantExpression()
1 call to Twig_ExpressionParser::checkConstantExpression()
Twig_ExpressionParser::parseArguments in vendor/twig/twig/lib/Twig/ExpressionParser.php
Parses arguments.

File

vendor/twig/twig/lib/Twig/ExpressionParser.php, line 625

Class

Twig_ExpressionParser
Parses expressions.

Code

protected function checkConstantExpression(Twig_NodeInterface $node) {
  if (!($node instanceof Twig_Node_Expression_Constant || $node instanceof Twig_Node_Expression_Array || $node instanceof Twig_Node_Expression_Unary_Neg || $node instanceof Twig_Node_Expression_Unary_Pos)) {
    return false;
  }
  foreach ($node as $n) {
    if (!$this
      ->checkConstantExpression($n)) {
      return false;
    }
  }
  return true;
}