Skip to content

Commit

Permalink
Deprecate FaNode
Browse files Browse the repository at this point in the history
… let's use a TextNode instead.
  • Loading branch information
derrabus committed Sep 3, 2024
1 parent 95b7420 commit 2c461a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/Twig/FaNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
use Twig\Attribute\YieldReady;
use Twig\Compiler;
use Twig\Node\Node;
use Twig\Node\TextNode;

/** @deprecated use {@see TextNode} instead. */
#[YieldReady]
final class FaNode extends Node
{
Expand Down
6 changes: 3 additions & 3 deletions src/Twig/FaTokenParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Rabus\TwigAwesomeBundle\Twig;

use Rabus\TwigAwesomeBundle\IconLocator;
use Twig\Node\Node;
use Twig\Node\TextNode;
use Twig\Token;
use Twig\TokenParser\AbstractTokenParser;

Expand All @@ -16,7 +16,7 @@ public function __construct(
) {
}

public function parse(Token $token): Node
public function parse(Token $token): TextNode
{
$stream = $this->parser->getStream();

Expand All @@ -32,7 +32,7 @@ public function parse(Token $token): Node
);
$stream->expect(Token::BLOCK_END_TYPE);

return new FaNode($this->iconLocator->getSvg($collection, $faId), $token->getLine(), $this->getTag());
return new TextNode($this->iconLocator->getSvg($collection, $faId), $token->getLine());
}

public function getTag(): string
Expand Down

0 comments on commit 2c461a2

Please sign in to comment.