Skip to content

Commit

Permalink
Merge pull request #14 from MauricioFauth/twig-3.12
Browse files Browse the repository at this point in the history
Fix deprecation with Twig 3.12
  • Loading branch information
MauricioFauth committed Aug 31, 2024
2 parents 6981740 + b3f96ff commit 096e123
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Node/TransNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

use Twig\Attribute\YieldReady;
use Twig\Compiler;
use Twig\Environment;
use Twig\Node\CheckToStringNode;
use Twig\Node\Expression\AbstractExpression;
use Twig\Node\Expression\ConstantExpression;
Expand Down Expand Up @@ -100,6 +101,13 @@ public function __construct(
$nodes['context'] = $context;
}

/** @phpstan-ignore-next-line */
if (Environment::VERSION_ID >= 301200) {
parent::__construct($nodes, [], $lineno);

return;
}

parent::__construct($nodes, [], $lineno, $tag);
}

Expand Down

0 comments on commit 096e123

Please sign in to comment.