Skip to content

Commit 39215f0

Browse files
committed
Move Operators to ExpressionParsers, deprecate ExpressionParser
1 parent 5f656ba commit 39215f0

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

TokenParser/CacheTokenParser.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ class CacheTokenParser extends AbstractTokenParser
2424
public function parse(Token $token): Node
2525
{
2626
$stream = $this->parser->getStream();
27-
$expressionParser = $this->parser->getExpressionParser();
28-
$key = $expressionParser->parseExpression();
27+
$key = $this->parser->parseExpression();
2928

3029
$ttl = null;
3130
$tags = null;
@@ -41,7 +40,7 @@ public function parse(Token $token): Node
4140
if ($stream->test(Token::PUNCTUATION_TYPE, ')')) {
4241
throw new SyntaxError(\sprintf('The "%s" modifier takes exactly one argument (0 given).', $k), $line, $stream->getSourceContext());
4342
}
44-
$arg = $expressionParser->parseExpression();
43+
$arg = $this->parser->parseExpression();
4544
if ($stream->test(Token::PUNCTUATION_TYPE, ',')) {
4645
throw new SyntaxError(\sprintf('The "%s" modifier takes exactly one argument (2 given).', $k), $line, $stream->getSourceContext());
4746
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"require": {
1818
"php": ">=8.1.0",
1919
"symfony/cache": "^5.4|^6.4|^7.0",
20-
"twig/twig": "^3.19|^4.0"
20+
"twig/twig": "^3.20|^4.0"
2121
},
2222
"require-dev": {
2323
"symfony/phpunit-bridge": "^6.4|^7.0"

0 commit comments

Comments
 (0)