fix compatibility with Twig >= 2.6.1
This commit is contained in:
parent
51d4ca3756
commit
40089fb28f
@ -68,7 +68,7 @@ class TransChoiceTokenParser extends TransTokenParser
|
|||||||
$body = $this->parser->subparse(array($this, 'decideTransChoiceFork'), true);
|
$body = $this->parser->subparse(array($this, 'decideTransChoiceFork'), true);
|
||||||
|
|
||||||
if (!$body instanceof TextNode && !$body instanceof AbstractExpression) {
|
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);
|
$stream->expect(Token::BLOCK_END_TYPE);
|
||||||
|
@ -60,7 +60,7 @@ class TransTokenParser extends AbstractTokenParser
|
|||||||
$stream->next();
|
$stream->next();
|
||||||
$locale = $this->parser->getExpressionParser()->parseExpression();
|
$locale = $this->parser->getExpressionParser()->parseExpression();
|
||||||
} elseif (!$stream->test(Token::BLOCK_END_TYPE)) {
|
} 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);
|
$body = $this->parser->subparse(array($this, 'decideTransFork'), true);
|
||||||
|
|
||||||
if (!$body instanceof TextNode && !$body instanceof AbstractExpression) {
|
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);
|
$stream->expect(Token::BLOCK_END_TYPE);
|
||||||
|
Reference in New Issue
Block a user