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

Breadcrumb

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

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\Collection

Code

public function offer(mixed $element) : bool {
    try {
        return $this->add($element);
    } catch (InvalidArgumentException) {
        return false;
    }
}
RSS feed
Powered by Drupal