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

Breadcrumb

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

function Queue::peek

Return value

T | null

Overrides QueueInterface::peek

2 calls to Queue::peek()
DoubleEndedQueue::peekFirst in vendor/ramsey/collection/src/DoubleEndedQueue.php
Queue::element in vendor/ramsey/collection/src/Queue.php

File

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

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 peek() : mixed {
    $index = array_key_first($this->data);
    if ($index === null) {
        return null;
    }
    return $this[$index];
}
RSS feed
Powered by Drupal