Node example

new Token(Token::NAME_TYPE, 'extends', 2),
            new Token(Token::STRING_TYPE, $parent, 2),
            new Token(Token::BLOCK_END_TYPE, '', 2),
        ];

        if ($this->shouldEndFile($options['scopes']$source)) {
            $tokens[] = new Token(Token::EOF_TYPE, '', $token->getLine());
        }

        $stream->injectTokens($tokens);

        return new Node();
    }

    public function getTag(): string
    {
        return 'sw_extends';
    }

    /** * @return array{template: string, scopes: string[]} */
    private function getOptions(TokenStream $stream): array
    {
Home | Imprint | This part of the site doesn't use cookies.