Skip to content

Commit d05e9d3

Browse files
committed
Fix ComponentNode "useYield" weird behaviour
1 parent 9f1dbc9 commit d05e9d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/TwigComponent/src/Twig/ComponentNode.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function compile(Compiler $compiler): void
4949
{
5050
$compiler->addDebugInfo($this);
5151

52-
$useYield = $compiler->getEnvironment()->useYield();
52+
$useYield = method_exists(Environment::class, 'useYield') && $compiler->getEnvironment()->useYield();
5353

5454
// since twig/twig 3.9.0: Using the internal "twig_to_array" function is deprecated.
5555
if (method_exists(CoreExtension::class, 'toArray')) {

0 commit comments

Comments
 (0)