Skip to content

Commit b3f96ff

Browse files
committed
Fix deprecation with Twig 3.12
Signed-off-by: Maurício Meneghini Fauth <[email protected]>
1 parent 6981740 commit b3f96ff

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Node/TransNode.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
use Twig\Attribute\YieldReady;
1818
use Twig\Compiler;
19+
use Twig\Environment;
1920
use Twig\Node\CheckToStringNode;
2021
use Twig\Node\Expression\AbstractExpression;
2122
use Twig\Node\Expression\ConstantExpression;
@@ -100,6 +101,13 @@ public function __construct(
100101
$nodes['context'] = $context;
101102
}
102103

104+
/** @phpstan-ignore-next-line */
105+
if (Environment::VERSION_ID >= 301200) {
106+
parent::__construct($nodes, [], $lineno);
107+
108+
return;
109+
}
110+
103111
parent::__construct($nodes, [], $lineno, $tag);
104112
}
105113

0 commit comments

Comments
 (0)