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\CollectionCode
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;
}