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

Breadcrumb

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

function TokenStream::next

Sets the pointer to the next token and returns the old one.

2 calls to TokenStream::next()
TokenStream::expect in vendor/twig/twig/src/TokenStream.php
Tests a token and returns it or throws a syntax error.
TokenStream::nextIf in vendor/twig/twig/src/TokenStream.php
Tests a token, sets the pointer to the next one and returns it or throws a syntax error.

File

vendor/twig/twig/src/TokenStream.php, line 50

Class

TokenStream
Represents a token stream.

Namespace

Twig

Code

public function next() : Token {
    if (!isset($this->tokens[++$this->current])) {
        throw new SyntaxError('Unexpected end of template.', $this->tokens[$this->current - 1]
            ->getLine(), $this->source);
    }
    return $this->tokens[$this->current - 1];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal