Skip to content

Commit

Permalink
fix compatibility with Twig >= 2.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Jan 14, 2019
1 parent 51d4ca3 commit 40089fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -68,7 +68,7 @@ public function parse(Token $token)
$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);
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php
Expand Up @@ -60,7 +60,7 @@ public function parse(Token $token)
$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());
}
}

Expand All @@ -69,7 +69,7 @@ public function parse(Token $token)
$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);
Expand Down

0 comments on commit 40089fb

Please sign in to comment.