Skip to content

Commit c912fc2

Browse files
committed
try method_exists
1 parent 0839eea commit c912fc2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/TwigComponent/src/Twig/ComponentNode.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Twig\Node\Expression\AbstractExpression;
2020
use Twig\Node\Node;
2121
use Twig\Node\NodeOutputInterface;
22+
use Twig\Template;
2223

2324
/**
2425
* @author Fabien Potencier <[email protected]>
@@ -155,7 +156,7 @@ public function compile(Compiler $compiler): void
155156
$compiler->write('yield from ');
156157
}
157158

158-
if (Environment::VERSION_ID >= 32100) {
159+
if (method_exists(Template::class, 'load')) {
159160
$compiler
160161
->write('$this->load(')
161162
->string($this->getAttribute('embedded_template'))

0 commit comments

Comments
 (0)