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/nikic/php-parser/lib/PhpParser/Token.php \PhpParser\Token
  4. 11.1.x vendor/twig/twig/src/Token.php \Twig\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

CSS selector token.

This component is a port of the Python cssselect library, which is copyright Ian Bicking, @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>

@internal

Hierarchy

  • class \Symfony\Component\CssSelector\Parser\Token

Expanded class hierarchy of Token

See also

https://github.com/SimonSapin/cssselect.

8 files declare their use of Token
FunctionNode.php in vendor/symfony/css-selector/Node/FunctionNode.php
HashHandler.php in vendor/symfony/css-selector/Parser/Handler/HashHandler.php
IdentifierHandler.php in vendor/symfony/css-selector/Parser/Handler/IdentifierHandler.php
NumberHandler.php in vendor/symfony/css-selector/Parser/Handler/NumberHandler.php
StringHandler.php in vendor/symfony/css-selector/Parser/Handler/StringHandler.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/symfony/css-selector/Parser/Token.php, line 24

Namespace

Symfony\Component\CssSelector\Parser
View source
class Token {
    public const TYPE_FILE_END = 'eof';
    public const TYPE_DELIMITER = 'delimiter';
    public const TYPE_WHITESPACE = 'whitespace';
    public const TYPE_IDENTIFIER = 'identifier';
    public const TYPE_HASH = 'hash';
    public const TYPE_NUMBER = 'number';
    public const TYPE_STRING = 'string';
    public function __construct(?string $type, ?string $value, ?int $position) {
    }
    public function getType() : ?int {
        return $this->type;
    }
    public function getValue() : ?string {
        return $this->value;
    }
    public function getPosition() : ?int {
        return $this->position;
    }
    public function isFileEnd() : bool {
        return self::TYPE_FILE_END === $this->type;
    }
    public function isDelimiter(array $values = []) : bool {
        if (self::TYPE_DELIMITER !== $this->type) {
            return false;
        }
        if (!$values) {
            return true;
        }
        return \in_array($this->value, $values, true);
    }
    public function isWhitespace() : bool {
        return self::TYPE_WHITESPACE === $this->type;
    }
    public function isIdentifier() : bool {
        return self::TYPE_IDENTIFIER === $this->type;
    }
    public function isHash() : bool {
        return self::TYPE_HASH === $this->type;
    }
    public function isNumber() : bool {
        return self::TYPE_NUMBER === $this->type;
    }
    public function isString() : bool {
        return self::TYPE_STRING === $this->type;
    }
    public function __toString() : string {
        if ($this->value) {
            return \sprintf('<%s "%s" at %s>', $this->type, $this->value, $this->position);
        }
        return \sprintf('<%s at %s>', $this->type, $this->position);
    }

}

Members

Title Sort descending Modifiers Object type Summary
Token::getPosition public function
Token::getType public function
Token::getValue public function
Token::isDelimiter public function
Token::isFileEnd public function
Token::isHash public function
Token::isIdentifier public function
Token::isNumber public function
Token::isString public function
Token::isWhitespace public function
Token::TYPE_DELIMITER public constant
Token::TYPE_FILE_END public constant
Token::TYPE_HASH public constant
Token::TYPE_IDENTIFIER public constant
Token::TYPE_NUMBER public constant
Token::TYPE_STRING public constant
Token::TYPE_WHITESPACE public constant
Token::__construct public function
Token::__toString public function

API Navigation

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