Skip to content

Commit 4317a27

Browse files
authored
YieldReady (#443)
* YieldReady * CS
1 parent 412cbdc commit 4317a27

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/Node/EventNode.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@
66
use Illuminate\Support\Str;
77
use Illuminate\View\View;
88
use Illuminate\View\ViewName;
9+
use Twig\Attribute\YieldReady;
910
use Twig\Compiler;
1011
use Twig\Node\Node;
1112

13+
#[YieldReady]
1214
class EventNode extends Node
1315
{
1416

1517
public function compile(Compiler $compiler): void
1618
{
1719
$compiler
1820
->write(
19-
sprintf(
20-
'$context = ' .
21-
EventNode::class . '::triggerLaravelEvents($this->getTemplateName(), $context);'
22-
)
21+
'$context = ' . EventNode::class . '::triggerLaravelEvents($this->getTemplateName(), $context);'
2322
)
2423
->raw("\n");
2524
}

src/Node/GetAttrNode.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88
namespace TwigBridge\Node;
99

10+
use Twig\Attribute\YieldReady;
1011
use Twig\Compiler;
1112
use Twig\Environment;
1213
use Twig\Error\RuntimeError;
@@ -24,6 +25,7 @@
2425
* - https://github.com/rcrowe/TwigBridge/issues/362
2526
* - https://github.com/rcrowe/TwigBridge/issues/265
2627
*/
28+
#[YieldReady]
2729
class GetAttrNode extends GetAttrExpression
2830
{
2931
/**
@@ -145,6 +147,15 @@ public static function attribute(
145147
return $object->$item;
146148
}
147149

148-
return CoreExtension::getAttribute($env, $source, $object, $item, $arguments, $type, $isDefinedTest, $ignoreStrictCheck);
150+
return CoreExtension::getAttribute(
151+
$env,
152+
$source,
153+
$object,
154+
$item,
155+
$arguments,
156+
$type,
157+
$isDefinedTest,
158+
$ignoreStrictCheck
159+
);
149160
}
150161
}

0 commit comments

Comments
 (0)