diff --git a/docs/collection/api/list.md b/docs/collection/api/list.md index e5ba468..9f14294 100644 --- a/docs/collection/api/list.md +++ b/docs/collection/api/list.md @@ -107,7 +107,7 @@ Remove all occurrences of the element. Returns `$this`. ```php removeAt(int $index): MutableList ``` -Remove element at index. Throws `OutOfBoundsException`. Returns `$this`. +Remove element at index. Throws `IndexOutOfBoundsException` if out of bounds. Returns `$this`. ## ImmutableList Methods diff --git a/src/List/ImmutableList.php b/src/List/ImmutableList.php index ac478bf..d302621 100644 --- a/src/List/ImmutableList.php +++ b/src/List/ImmutableList.php @@ -14,7 +14,6 @@ use Noctud\Collection\Exception\IndexOutOfBoundsException; use Noctud\Collection\ImmutableCollection; use Noctud\Collection\Map\ImmutableMap; -use OutOfBoundsException; /** * @template E @@ -67,7 +66,7 @@ public function removeEvery(mixed $element): ImmutableList; * * @param int $index The index of the element to remove * @return ImmutableList A new list without the element at the specified index - * @throws OutOfBoundsException If the index is out of bounds + * @throws IndexOutOfBoundsException If the index is out of bounds */ #[NoDiscard] public function removeAt(int $index): ImmutableList; diff --git a/src/List/MutableList.php b/src/List/MutableList.php index bd000dc..940bc5a 100644 --- a/src/List/MutableList.php +++ b/src/List/MutableList.php @@ -13,7 +13,6 @@ use NoDiscard; use Noctud\Collection\Exception\IndexOutOfBoundsException; use Noctud\Collection\MutableCollection; -use OutOfBoundsException; /** * @template E @@ -226,7 +225,7 @@ public function removeEvery(mixed $element): MutableList; * * @param int $index The index of the element to remove * @return MutableList The list itself for chaining - * @throws OutOfBoundsException If the index is out of bounds + * @throws IndexOutOfBoundsException If the index is out of bounds */ public function removeAt(int $index): MutableList; diff --git a/src/List/MutableTrackedList.php b/src/List/MutableTrackedList.php index a42a9e5..8daa1d8 100644 --- a/src/List/MutableTrackedList.php +++ b/src/List/MutableTrackedList.php @@ -13,7 +13,6 @@ use Noctud\Collection\Exception\IndexOutOfBoundsException; use Noctud\Collection\MutableTrackedCollection; use Noctud\Collection\TrackedResult; -use OutOfBoundsException; /** * A mutable list that tracks whether the last mutation operation changed the list. @@ -206,7 +205,7 @@ public function removeEvery(mixed $element): MutableTrackedList&TrackedResult; * * @param int $index The index of the element to remove * @return MutableTrackedList&TrackedResult The list itself for chaining - * @throws OutOfBoundsException If the index is out of bounds + * @throws IndexOutOfBoundsException If the index is out of bounds */ public function removeAt(int $index): MutableTrackedList&TrackedResult; diff --git a/src/List/WritableList.php b/src/List/WritableList.php index f0d53fd..18a1312 100644 --- a/src/List/WritableList.php +++ b/src/List/WritableList.php @@ -14,7 +14,6 @@ use Noctud\Collection\Map\ImmutableMap; use Noctud\Collection\WritableCollection; use NoDiscard; -use OutOfBoundsException; /** * Writable list provides basic methods for read/write operations on a list. @@ -63,7 +62,7 @@ public function removeEvery(mixed $element): WritableList; * * @param int $index The index of the element to remove * @return WritableList The list itself for chaining - * @throws OutOfBoundsException If the index is out of bounds + * @throws IndexOutOfBoundsException If the index is out of bounds */ public function removeAt(int $index): WritableList; diff --git a/src/List/WritableTrackedList.php b/src/List/WritableTrackedList.php index ae9a24d..d294b29 100644 --- a/src/List/WritableTrackedList.php +++ b/src/List/WritableTrackedList.php @@ -13,7 +13,6 @@ use Noctud\Collection\Exception\IndexOutOfBoundsException; use Noctud\Collection\TrackedResult; use Noctud\Collection\WritableTrackedCollection; -use OutOfBoundsException; /** * A writable list that tracks whether the last mutation operation changed the list. @@ -49,7 +48,7 @@ public function removeEvery(mixed $element): WritableTrackedList&TrackedResult; * * @param int $index The index of the element to remove * @return WritableTrackedList&TrackedResult The list itself for chaining - * @throws OutOfBoundsException If the index is out of bounds + * @throws IndexOutOfBoundsException If the index is out of bounds */ public function removeAt(int $index): WritableTrackedList&TrackedResult;