From 40089fb28f78df9bda2c4fa043df11b187efccb8 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 14 Jan 2019 11:10:57 +0100 Subject: [PATCH] fix compatibility with Twig >= 2.6.1 --- .../Bridge/Twig/TokenParser/TransChoiceTokenParser.php | 2 +- src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php b/src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php index 5261d7ad52..1cda1dcb3c 100644 --- a/src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php +++ b/src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php @@ -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); diff --git a/src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php b/src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php index 76c8dc0610..5fe2255fcd 100644 --- a/src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php +++ b/src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php @@ -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);