function Queue::offer
Overrides QueueInterface::offer
1 call to Queue::offer()
- DoubleEndedQueue::offerLast in vendor/
ramsey/ collection/ src/ DoubleEndedQueue.php - Inserts the specified element at the end of this queue if it is possible to do so immediately without violating capacity restrictions.
File
-
vendor/
ramsey/ collection/ src/ Queue.php, line 92
Class
- Queue
- This class provides a basic implementation of `QueueInterface`, to minimize the effort required to implement this interface.
Namespace
Ramsey\CollectionCode
public function offer(mixed $element) : bool {
try {
return $this->add($element);
} catch (InvalidArgumentException) {
return false;
}
}