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

Breadcrumb

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

function DoubleEndedQueueInterface::offerFirst

Inserts the specified element at the front of this queue if it is possible to do so immediately without violating capacity restrictions.

When using a capacity-restricted queue, this method is generally preferable to `addFirst()`, which can fail to insert an element only by throwing an exception.

Parameters

T $element The element to add to the front of this queue.:

Return value

bool `true` if the element was added to this queue, else `false`.

1 method overrides DoubleEndedQueueInterface::offerFirst()
DoubleEndedQueue::offerFirst in vendor/ramsey/collection/src/DoubleEndedQueue.php
Inserts the specified element at the front of this queue if it is possible to do so immediately without violating capacity restrictions.

File

vendor/ramsey/collection/src/DoubleEndedQueueInterface.php, line 218

Class

DoubleEndedQueueInterface
A linear collection that supports element insertion and removal at both ends.

Namespace

Ramsey\Collection

Code

public function offerFirst(mixed $element) : bool;
RSS feed
Powered by Drupal