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

Breadcrumb

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

function Queue::offsetSet

Since arbitrary offsets may not be manipulated in a queue, this method serves only to fulfill the `ArrayAccess` interface requirements. It is invoked by other operations when adding values to the queue.

Throws

InvalidArgumentException if $value is of the wrong type.

Overrides AbstractArray::offsetSet

File

vendor/ramsey/collection/src/Queue.php, line 58

Class

Queue
This class provides a basic implementation of `QueueInterface`, to minimize the effort required to implement this interface.

Namespace

Ramsey\Collection

Code

public function offsetSet(mixed $offset, mixed $value) : void {
    if ($this->checkType($this->getType(), $value) === false) {
        throw new InvalidArgumentException('Value must be of type ' . $this->getType() . '; value is ' . $this->toolValueToString($value));
    }
    $this->data[] = $value;
}
RSS feed
Powered by Drupal