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

Breadcrumb

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

function Queue::element

Return value

T

Throws

NoSuchElementException if this queue is empty.

Overrides QueueInterface::element

1 call to Queue::element()
DoubleEndedQueue::firstElement in vendor/ramsey/collection/src/DoubleEndedQueue.php

File

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

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 element() : mixed {
    return $this->peek() ?? throw new NoSuchElementException('Can\'t return element from Queue. Queue is empty.');
}
RSS feed
Powered by Drupal