Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/collection/api/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Remove all occurrences of the element. Returns `$this`.
```php
removeAt(int $index): MutableList<E>
```
Remove element at index. Throws `OutOfBoundsException`. Returns `$this`.
Remove element at index. Throws `IndexOutOfBoundsException` if out of bounds. Returns `$this`.

## ImmutableList Methods

Expand Down
3 changes: 1 addition & 2 deletions src/List/ImmutableList.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Noctud\Collection\Exception\IndexOutOfBoundsException;
use Noctud\Collection\ImmutableCollection;
use Noctud\Collection\Map\ImmutableMap;
use OutOfBoundsException;

/**
* @template E
Expand Down Expand Up @@ -67,7 +66,7 @@ public function removeEvery(mixed $element): ImmutableList;
*
* @param int $index The index of the element to remove
* @return ImmutableList<E> 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;
Expand Down
3 changes: 1 addition & 2 deletions src/List/MutableList.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use NoDiscard;
use Noctud\Collection\Exception\IndexOutOfBoundsException;
use Noctud\Collection\MutableCollection;
use OutOfBoundsException;

/**
* @template E
Expand Down Expand Up @@ -226,7 +225,7 @@ public function removeEvery(mixed $element): MutableList;
*
* @param int $index The index of the element to remove
* @return MutableList<E> 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;

Expand Down
3 changes: 1 addition & 2 deletions src/List/MutableTrackedList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -206,7 +205,7 @@ public function removeEvery(mixed $element): MutableTrackedList&TrackedResult;
*
* @param int $index The index of the element to remove
* @return MutableTrackedList<E>&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;

Expand Down
3 changes: 1 addition & 2 deletions src/List/WritableList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -63,7 +62,7 @@ public function removeEvery(mixed $element): WritableList;
*
* @param int $index The index of the element to remove
* @return WritableList<E> 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;

Expand Down
3 changes: 1 addition & 2 deletions src/List/WritableTrackedList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -49,7 +48,7 @@ public function removeEvery(mixed $element): WritableTrackedList&TrackedResult;
*
* @param int $index The index of the element to remove
* @return WritableTrackedList<E>&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;

Expand Down
Loading