Skip to content

Commit

Permalink
Make FaNode "yield ready"
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed May 2, 2024
1 parent f4919fd commit 99edfd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"fortawesome/font-awesome": "^6.5.1",
"symfony/dependency-injection": "^6.4 || ^7",
"symfony/http-kernel": "^6.4 || ^7",
"twig/twig": "^3.5"
"twig/twig": "^3.9"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.50",
Expand Down
4 changes: 3 additions & 1 deletion src/Twig/FaNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

namespace Rabus\TwigAwesomeBundle\Twig;

use Twig\Attribute\YieldReady;
use Twig\Compiler;
use Twig\Node\Node;

#[YieldReady]
final class FaNode extends Node
{
public function __construct(string $svg, int $lineno = 0, ?string $tag = null)
Expand All @@ -22,7 +24,7 @@ public function __construct(string $svg, int $lineno = 0, ?string $tag = null)
public function compile(Compiler $compiler): void
{
$compiler->addDebugInfo($this)
->raw('echo ')
->raw('yield ')
->string($this->attributes['svg'])
->raw(';')
;
Expand Down

0 comments on commit 99edfd0

Please sign in to comment.