Skip to content

Commit

Permalink
YieldReady
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh committed Apr 24, 2024
1 parent 412cbdc commit 3ad1d65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Node/EventNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@
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
{

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");
}
Expand Down
2 changes: 2 additions & 0 deletions src/Node/GetAttrNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
namespace TwigBridge\Node;

use Twig\Attribute\YieldReady;
use Twig\Compiler;
use Twig\Environment;
use Twig\Error\RuntimeError;
Expand All @@ -24,6 +25,7 @@
* - https://github.com/rcrowe/TwigBridge/issues/362
* - https://github.com/rcrowe/TwigBridge/issues/265
*/
#[YieldReady]
class GetAttrNode extends GetAttrExpression
{
/**
Expand Down

0 comments on commit 3ad1d65

Please sign in to comment.