From bd4b72168f80fbcfe531afa8d4faaefa825bf162 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 13 Nov 2023 15:18:16 +0100 Subject: [PATCH] Make setIteratorMode final for stacks and queues --- src/DataStructures/StrictQueue.php | 2 +- src/DataStructures/StrictStack.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DataStructures/StrictQueue.php b/src/DataStructures/StrictQueue.php index 2401859..daa065c 100644 --- a/src/DataStructures/StrictQueue.php +++ b/src/DataStructures/StrictQueue.php @@ -47,7 +47,7 @@ class StrictQueue extends StrictList * * @throws \RuntimeException */ - public function setIteratorMode(int $mode): int + final public function setIteratorMode(int $mode): int { if ($mode > 1) { throw new RuntimeException('Changing the iterator direction of ' . static::class . ' is prohibited.'); diff --git a/src/DataStructures/StrictStack.php b/src/DataStructures/StrictStack.php index ee90be1..71f73c6 100644 --- a/src/DataStructures/StrictStack.php +++ b/src/DataStructures/StrictStack.php @@ -47,7 +47,7 @@ class StrictStack extends StrictList * * @throws \RuntimeException */ - public function setIteratorMode(int $mode): int + final public function setIteratorMode(int $mode): int { if ($mode < 2) { throw new RuntimeException('Changing the iterator direction of ' . static::class . ' is prohibited.');