mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-03 22:17:36 +00:00
bug #4683 Fix compatibility layer (fabpot)
This PR was merged into the 3.x branch.
Discussion
----------
Fix compatibility layer
Closes #4652
Commits
-------
806049f7a2 Fix compatibility layer
This commit is contained in:
@@ -214,7 +214,7 @@ class ExpressionParser
|
||||
{
|
||||
trigger_deprecation('twig/twig', '3.19', \sprintf('The "%s()" method is deprecated, use "Twig\ExpressionParser\Infix\ArgumentsTrait::parseNamedArguments()" instead.', __METHOD__));
|
||||
|
||||
$parsePrimary = new \ReflectionMethod($this->parser, 'parsePrimary');
|
||||
$parsePrimaryExpression = new \ReflectionMethod($this->parser, 'parsePrimaryExpression');
|
||||
|
||||
$namedArguments = false;
|
||||
$definition = false;
|
||||
@@ -263,7 +263,7 @@ class ExpressionParser
|
||||
$name = $value->getAttribute('name');
|
||||
|
||||
if ($definition) {
|
||||
$value = $parsePrimary->invoke($this->parser);
|
||||
$value = $parsePrimaryExpression->invoke($this->parser);
|
||||
|
||||
if (!$this->checkConstantExpression($value)) {
|
||||
throw new SyntaxError('A default value for an argument must be a constant (a boolean, a string, a number, a sequence, or a mapping).', $token->getLine(), $stream->getSourceContext());
|
||||
|
||||
Reference in New Issue
Block a user