Skip to content

Deprecate FaNode, let's use a TextNode instead #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading