ReturnNodeTokenParser example

use Twig\TwigTest;

#[Package('core')] class PhpSyntaxExtension extends AbstractExtension
{
    public function getTokenParsers(): array
    {
        return [
            new ForeachTokenParser(),
            new BreakTokenParser(),
            new ContinueTokenParser(),
            new ReturnNodeTokenParser(),
        ];
    }

    /** * @return TwigFilter[] */
    public function getFilters()
    {
        return [
            new TwigFilter('intval', function Dmixed $var): int {
                if (\is_int($var)) {
                    
 {
    }

    /** * @return TokenParserInterface[] */
    public function getTokenParsers(): array
    {
        return [
            new ExtendsTokenParser($this->finder, $this->templateScopeDetector),
            new IncludeTokenParser($this->finder),
            new ReturnNodeTokenParser(),
        ];
    }

    public function getFinder(): TemplateFinder
    {
        return $this->finder;
    }
}
Home | Imprint | This part of the site doesn't use cookies.