You are here

protected function Twig_ExpressionParser::checkConstantExpression in Translation template extractor 6.3

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

File

vendor/Twig/ExpressionParser.php, line 584

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)) {
    return false;
  }
  foreach ($node as $n) {
    if (!$this
      ->checkConstantExpression($n)) {
      return false;
    }
  }
  return true;
}