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

Breadcrumb

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

class Token

Same name in this branch
  1. 11.1.x vendor/theseer/tokenizer/src/Token.php \TheSeer\Tokenizer\Token
  2. 11.1.x vendor/doctrine/lexer/src/Token.php \Doctrine\Common\Lexer\Token
  3. 11.1.x vendor/twig/twig/src/Token.php \Twig\Token
  4. 11.1.x vendor/symfony/css-selector/Parser/Token.php \Symfony\Component\CssSelector\Parser\Token
  5. 11.1.x vendor/mck89/peast/lib/Peast/Syntax/Token.php \Peast\Syntax\Token
  6. 11.1.x core/lib/Drupal/Core/Render/Element/Token.php \Drupal\Core\Render\Element\Token
  7. 11.1.x core/lib/Drupal/Core/Utility/Token.php \Drupal\Core\Utility\Token

A PHP token. On PHP 8.0 this extends from PhpToken.

Hierarchy

  • class \PhpParser\Token extends \Internal\TokenPolyfill

Expanded class hierarchy of Token

9 files declare their use of Token
AsymmetricVisibilityTokenEmulator.php in vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AsymmetricVisibilityTokenEmulator.php
AttributeEmulator.php in vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php
CommentAnnotatingVisitor.php in vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php
Emulative.php in vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php
ExplicitOctalEmulator.php in vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php

... See full list

15 string references to 'Token'
AbstractPatternSniff::createTokenPattern in vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractPatternSniff.php
Creates a token pattern.
AbstractPatternSniff::getPatternTokenTypes in vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractPatternSniff.php
Returns the token types that the specified pattern is checking for.
AbstractPatternSniff::processPattern in vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractPatternSniff.php
Processes the pattern and verifies the code at $stackPtr.
BatchStorage::schemaDefinition in core/lib/Drupal/Core/Batch/BatchStorage.php
Defines the schema for the batch table.
ContentTranslationHandler::entityFormSharedElements in core/modules/content_translation/src/ContentTranslationHandler.php
Process callback: determines which elements get clue in the form.

... See full list

File

vendor/nikic/php-parser/lib/PhpParser/Token.php, line 8

Namespace

PhpParser
View source
class Token extends Internal\TokenPolyfill {
    
    /** Get (exclusive) zero-based end position of the token. */
    public function getEndPos() : int {
        return $this->pos + \strlen($this->text);
    }
    
    /** Get 1-based end line number of the token. */
    public function getEndLine() : int {
        return $this->line + \substr_count($this->text, "\n");
    }

}

Members

Title Sort descending Modifiers Object type Summary
Token::getEndLine public function Get 1-based end line number of the token.
Token::getEndPos public function Get (exclusive) zero-based end position of the token.

API Navigation

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