diff --git a/src/DataStructures/StrictQueue.php b/src/DataStructures/StrictQueue.php index 7ef4ec9..caa9cb4 100644 --- a/src/DataStructures/StrictQueue.php +++ b/src/DataStructures/StrictQueue.php @@ -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 */ 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. *