Merge branch '2.x' into 3.x

* 2.x:
  Add a test
  Added token type and value to error message
  Add phpdoc to SecurityPolicyInterface
This commit is contained in:
Fabien Potencier
2022-03-25 09:18:59 +01:00
3 changed files with 19 additions and 1 deletions
+1 -1
View File
@@ -485,7 +485,7 @@ class ExpressionParser
}
}
} else {
throw new SyntaxError('Expected name or number.', $lineno, $stream->getSourceContext());
throw new SyntaxError(sprintf('Expected name or number, got value "%s" of type %s.', $token->getValue(), Token::typeToEnglish($token->getType())), $lineno, $stream->getSourceContext());
}
if ($node instanceof NameExpression && null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) {