Add StrictQueue::dequeue() method
This commit is contained in:
parent
3fddb3981e
commit
c018fc4979
|
@ -25,6 +25,7 @@ namespace OCC\Basics\DataStructures;
|
|||
|
||||
use OCC\Basics\DataStructures\Exceptions\InvalidDataTypeException;
|
||||
use OCC\Basics\DataStructures\Traits\StrictSplDoublyLinkedListTrait;
|
||||
use RuntimeException;
|
||||
use SplQueue;
|
||||
|
||||
/**
|
||||
|
@ -47,6 +48,20 @@ class StrictQueue extends SplQueue
|
|||
/** @use StrictSplDoublyLinkedListTrait<AllowedType> */
|
||||
use StrictSplDoublyLinkedListTrait;
|
||||
|
||||
/**
|
||||
* Dequeue an item from the queue.
|
||||
*
|
||||
* @return AllowedType The dequeued item
|
||||
*
|
||||
* @throws RuntimeException if the queue is empty
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function dequeue(): mixed
|
||||
{
|
||||
return $this->shift();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an item to the queue.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue