function TokenCollection::offsetSet
Parameters
Token $value:
Throws
File
-
vendor/
theseer/ tokenizer/ src/ TokenCollection.php, line 64
Class
Namespace
TheSeer\TokenizerCode
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;
}