fix compatibility with Twig >= 2.6.1

This commit is contained in:
Christian Flothmann 2019-01-14 11:10:57 +01:00
parent 51d4ca3756
commit 40089fb28f
2 changed files with 3 additions and 3 deletions

View File

@ -68,7 +68,7 @@ class TransChoiceTokenParser extends TransTokenParser
$body = $this->parser->subparse(array($this, 'decideTransChoiceFork'), true);
if (!$body instanceof TextNode && !$body instanceof AbstractExpression) {
throw new SyntaxError('A message inside a transchoice tag must be a simple text.', $body->getTemplateLine(), $stream->getSourceContext()->getName());
throw new SyntaxError('A message inside a transchoice tag must be a simple text.', $body->getTemplateLine(), $stream->getSourceContext());
}
$stream->expect(Token::BLOCK_END_TYPE);

View File

@ -60,7 +60,7 @@ class TransTokenParser extends AbstractTokenParser
$stream->next();
$locale = $this->parser->getExpressionParser()->parseExpression();
} elseif (!$stream->test(Token::BLOCK_END_TYPE)) {
throw new SyntaxError('Unexpected token. Twig was looking for the "with", "from", or "into" keyword.', $stream->getCurrent()->getLine(), $stream->getSourceContext()->getName());
throw new SyntaxError('Unexpected token. Twig was looking for the "with", "from", or "into" keyword.', $stream->getCurrent()->getLine(), $stream->getSourceContext());
}
}
@ -69,7 +69,7 @@ class TransTokenParser extends AbstractTokenParser
$body = $this->parser->subparse(array($this, 'decideTransFork'), true);
if (!$body instanceof TextNode && !$body instanceof AbstractExpression) {
throw new SyntaxError('A message inside a trans tag must be a simple text.', $body->getTemplateLine(), $stream->getSourceContext()->getName());
throw new SyntaxError('A message inside a trans tag must be a simple text.', $body->getTemplateLine(), $stream->getSourceContext());
}
$stream->expect(Token::BLOCK_END_TYPE);