Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DoTokenParser.php

class DoTokenParser

Evaluates an expression, discarding the returned value.

@internal

Hierarchy

  • class \Twig\TokenParser\AbstractTokenParser implements \Twig\TokenParser\TokenParserInterface
    • class \Twig\TokenParser\DoTokenParser extends \Twig\TokenParser\AbstractTokenParser

Expanded class hierarchy of DoTokenParser

1 file declares its use of DoTokenParser
CoreExtension.php in vendor/twig/twig/src/Extension/CoreExtension.php

File

vendor/twig/twig/src/TokenParser/DoTokenParser.php, line 23

Namespace

Twig\TokenParser
View source
final class DoTokenParser extends AbstractTokenParser {
    public function parse(Token $token) : Node {
        $expr = $this->parser
            ->getExpressionParser()
            ->parseExpression();
        $this->parser
            ->getStream()
            ->expect(Token::BLOCK_END_TYPE);
        return new DoNode($expr, $token->getLine());
    }
    public function getTag() : string {
        return 'do';
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
AbstractTokenParser::$parser protected property
AbstractTokenParser::setParser public function Sets the parser associated with this token parser. Overrides TokenParserInterface::setParser
DoTokenParser::getTag public function Gets the tag name associated with this token parser. Overrides TokenParserInterface::getTag
DoTokenParser::parse public function Parses a token and returns a node. Overrides TokenParserInterface::parse
RSS feed
Powered by Drupal