mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-03 22:17:36 +00:00
Use RawFilter in cache extra
This commit is contained in:
@@ -14,6 +14,7 @@ namespace Twig\Extra\Cache\TokenParser;
|
||||
use Twig\Error\SyntaxError;
|
||||
use Twig\Extra\Cache\Node\CacheNode;
|
||||
use Twig\Node\Expression\ConstantExpression;
|
||||
use Twig\Node\Expression\Filter\RawFilter;
|
||||
use Twig\Node\Expression\FilterExpression;
|
||||
use Twig\Node\Node;
|
||||
use Twig\Node\PrintNode;
|
||||
@@ -58,9 +59,8 @@ class CacheTokenParser extends AbstractTokenParser
|
||||
$stream->expect(Token::BLOCK_END_TYPE);
|
||||
|
||||
$body = new CacheNode($key, $ttl, $tags, $body, $token->getLine(), $this->getTag());
|
||||
$body = new FilterExpression($body, new ConstantExpression('raw', $token->getLine()), new Node(), $token->getLine());
|
||||
|
||||
return new PrintNode($body, $token->getLine(), $this->getTag());
|
||||
return new PrintNode(new RawFilter($body), $token->getLine(), $this->getTag());
|
||||
}
|
||||
|
||||
public function decideCacheEnd(Token $token): bool
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"symfony/cache": "^5.4|^6.4|^7.0",
|
||||
"twig/twig": "^3.9"
|
||||
"twig/twig": "^3.11"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/phpunit-bridge": "^6.4|^7.0"
|
||||
|
||||
Reference in New Issue
Block a user