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

Breadcrumb

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

function TokenCollection::offsetSet

Parameters

Token $value:

Throws

TokenCollectionException

File

vendor/theseer/tokenizer/src/TokenCollection.php, line 64

Class

TokenCollection

Namespace

TheSeer\Tokenizer

Code

public function offsetSet($offset, $value) : void {
    if (!\is_int($offset)) {
        $type = \gettype($offset);
        throw new TokenCollectionException(\sprintf('Offset must be of type integer, %s given', $type === 'object' ? \get_class($value) : $type));
    }
    if (!$value instanceof Token) {
        $type = \gettype($value);
        throw new TokenCollectionException(\sprintf('Value must be of type %s, %s given', Token::class, $type === 'object' ? \get_class($value) : $type));
    }
    $this->tokens[$offset] = $value;
}

API Navigation

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