diff --git a/src/Node/EventNode.php b/src/Node/EventNode.php index c09d9e1..286fa81 100644 --- a/src/Node/EventNode.php +++ b/src/Node/EventNode.php @@ -6,9 +6,11 @@ use Illuminate\Support\Str; use Illuminate\View\View; use Illuminate\View\ViewName; +use Twig\Attribute\YieldReady; use Twig\Compiler; use Twig\Node\Node; +#[YieldReady] class EventNode extends Node { @@ -16,10 +18,7 @@ public function compile(Compiler $compiler): void { $compiler ->write( - sprintf( - '$context = ' . - EventNode::class . '::triggerLaravelEvents($this->getTemplateName(), $context);' - ) + '$context = ' . EventNode::class . '::triggerLaravelEvents($this->getTemplateName(), $context);' ) ->raw("\n"); } diff --git a/src/Node/GetAttrNode.php b/src/Node/GetAttrNode.php index 81d619e..a6f7df4 100644 --- a/src/Node/GetAttrNode.php +++ b/src/Node/GetAttrNode.php @@ -7,6 +7,7 @@ */ namespace TwigBridge\Node; +use Twig\Attribute\YieldReady; use Twig\Compiler; use Twig\Environment; use Twig\Error\RuntimeError; @@ -24,6 +25,7 @@ * - https://github.com/rcrowe/TwigBridge/issues/362 * - https://github.com/rcrowe/TwigBridge/issues/265 */ +#[YieldReady] class GetAttrNode extends GetAttrExpression { /**