From 70c6a7813c1843bcc071d366dc888367e13e1300 Mon Sep 17 00:00:00 2001 From: pfmmfp Date: Wed, 21 Aug 2024 12:13:16 -0300 Subject: [PATCH 1/7] feat(collections): add fromItems to MutableVector --- src/Psl/Collection/MutableVector.php | 15 +++++++++++++++ tests/unit/Collection/MutableVectorTest.php | 8 +++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/Psl/Collection/MutableVector.php b/src/Psl/Collection/MutableVector.php index f6d7f360..26c465f0 100644 --- a/src/Psl/Collection/MutableVector.php +++ b/src/Psl/Collection/MutableVector.php @@ -14,6 +14,7 @@ use function array_keys; use function array_values; use function count; +use function iterator_to_array; /** * @template T @@ -69,6 +70,20 @@ public static function fromArray(array $elements): MutableVector return new self($elements); } + /** + * Create a vector from the given $items iterable. + * + * @template Ts + * + * @param iterable $items + * + * @return MutableVector + */ + public static function fromItems(iterable $items): MutableVector + { + return self::fromArray(iterator_to_array($items)); + } + /** * Returns the first value in the current `MutableVector`. * diff --git a/tests/unit/Collection/MutableVectorTest.php b/tests/unit/Collection/MutableVectorTest.php index 2fd0e75a..10f34084 100644 --- a/tests/unit/Collection/MutableVectorTest.php +++ b/tests/unit/Collection/MutableVectorTest.php @@ -149,7 +149,7 @@ public function testArrayAccess(): void static::assertTrue(isset($vector[0])); static::assertSame('foo', $vector[0]); - + unset($vector[0]); static::assertFalse(isset($vector[2])); @@ -230,6 +230,12 @@ public function testOffsetGetThrowsForInvalidOffsetType(): void $vector[false]; } + public function testFromItems(): void + { + $vector = MutableVector::fromItems([1, 2, 3]); + static::assertSame([1, 2, 3], $vector->toArray()); + } + /** * @template T From ce10be44a9d4ec045e1b6aa73c30b389fa5c2883 Mon Sep 17 00:00:00 2001 From: pfmmfp Date: Fri, 30 Aug 2024 16:43:23 -0300 Subject: [PATCH 2/7] adding fromItems all around --- src/Psl/Collection/Map.php | 13 +++++++++++++ src/Psl/Collection/MutableMap.php | 13 +++++++++++++ src/Psl/Collection/MutableSet.php | 14 ++++++++++++++ src/Psl/Collection/Set.php | 16 ++++++++++++++++ src/Psl/Collection/Vector.php | 14 ++++++++++++++ tests/unit/Collection/MapTest.php | 13 +++++++++++++ tests/unit/Collection/MutableMapTest.php | 14 +++++++++++++- tests/unit/Collection/MutableSetTest.php | 8 +++++++- tests/unit/Collection/MutableVectorTest.php | 1 - tests/unit/Collection/SetTest.php | 12 ++++++++++++ tests/unit/Collection/VectorTest.php | 6 ++++++ 11 files changed, 121 insertions(+), 3 deletions(-) diff --git a/src/Psl/Collection/Map.php b/src/Psl/Collection/Map.php index 55e1ed08..a4abb6ff 100644 --- a/src/Psl/Collection/Map.php +++ b/src/Psl/Collection/Map.php @@ -66,6 +66,19 @@ public static function fromArray(array $elements): Map return new self($elements); } + /** + * @template Tsk of array-key + * @template Tsv + * + * @param array $items + * + * @return Map + */ + public static function fromItems(iterable $items): Map + { + return self::fromArray(iterator_to_array($items)); + } + /** * Returns the first value in the current collection. * diff --git a/src/Psl/Collection/MutableMap.php b/src/Psl/Collection/MutableMap.php index cbe40aca..12a4d102 100644 --- a/src/Psl/Collection/MutableMap.php +++ b/src/Psl/Collection/MutableMap.php @@ -66,6 +66,19 @@ public static function fromArray(array $elements): MutableMap return new self($elements); } + /** + * @template Tsk of array-key + * @template Tsv + * + * @param array $items + * + * @return MutableMap + */ + public static function fromItems(iterable $items): MutableMap + { + return self::fromArray(iterator_to_array($items)); + } + /** * Returns the first value in the current collection. * diff --git a/src/Psl/Collection/MutableSet.php b/src/Psl/Collection/MutableSet.php index edf6e69d..f58c12bd 100644 --- a/src/Psl/Collection/MutableSet.php +++ b/src/Psl/Collection/MutableSet.php @@ -71,6 +71,20 @@ public static function fromArray(array $elements): MutableSet return new self($elements); } + /** + * Create a set from the given iterable, using the values of the iterable as the set values. + * + * @template Ts of array-key + * + * @param iterable $items + * + * @return MutableSet + */ + public static function fromItems(iterable $items): MutableSet + { + return self::fromArray(iterator_to_array($items)); + } + /** * Create a set from the given $elements array, using the keys of the array as the set values. * diff --git a/src/Psl/Collection/Set.php b/src/Psl/Collection/Set.php index 54a1e276..5d91a514 100644 --- a/src/Psl/Collection/Set.php +++ b/src/Psl/Collection/Set.php @@ -72,6 +72,22 @@ public static function fromArray(array $elements): Set return new self($elements); } + /** + * Create a set from the given items, using the keys of the array as the set values. + * + * @template Ts of array-key + * + * @param iterable $items + * + * @return Set + * + * @pure + */ + public static function fromItems(iterable $items): Set + { + return self::fromArray(iterator_to_array($items)); + } + /** * Create a set from the given $elements array, using the keys of the array as the set values. * diff --git a/src/Psl/Collection/Vector.php b/src/Psl/Collection/Vector.php index 2e34ef17..964c14c4 100644 --- a/src/Psl/Collection/Vector.php +++ b/src/Psl/Collection/Vector.php @@ -69,6 +69,20 @@ public static function fromArray(array $elements): Vector return new self($elements); } + /** + * Create a vector from the given $items iterable. + * + * @template Ts + * + * @param iterable $items + * + * @return Vector + */ + public static function fromItems(iterable $items): Vector + { + return self::fromArray(iterator_to_array($items)); + } + /** * Returns the first value in the current `Vector`. * diff --git a/tests/unit/Collection/MapTest.php b/tests/unit/Collection/MapTest.php index 3cb5b2dc..34d68050 100644 --- a/tests/unit/Collection/MapTest.php +++ b/tests/unit/Collection/MapTest.php @@ -19,6 +19,19 @@ final class MapTest extends AbstractMapTest */ protected string $vectorClass = Vector::class; + public function testFromItems(): void + { + $map = Map::fromItems([ + 'foo' => 'bar', + 'bar' => 'baz', + 'baz' => 'qux', + ]); + + static::assertSame('bar', $map->at('foo')); + static::assertSame('baz', $map->at('bar')); + static::assertSame('qux', $map->at('baz')); + } + /** * @template Tk of array-key * @template Tv diff --git a/tests/unit/Collection/MutableMapTest.php b/tests/unit/Collection/MutableMapTest.php index 619a71ca..fce753be 100644 --- a/tests/unit/Collection/MutableMapTest.php +++ b/tests/unit/Collection/MutableMapTest.php @@ -153,7 +153,7 @@ public function testArrayAccess(): void static::assertTrue(isset($map['foo'])); static::assertSame('1', $map['foo']); - + unset($map['foo']); static::assertFalse(isset($map['foo'])); @@ -235,6 +235,18 @@ public function testOffsetGetThrowsForInvalidOffsetType(): void $map[false]; } + public function testFromItems(): void { + $map = MutableMap::fromItems([ + 'foo' => 'bar', + 'bar' => 'baz', + 'baz' => 'qux', + ]); + + static::assertSame('bar', $map->at('foo')); + static::assertSame('baz', $map->at('bar')); + static::assertSame('qux', $map->at('baz')); + } + /** * @template Tk of array-key * @template Tv diff --git a/tests/unit/Collection/MutableSetTest.php b/tests/unit/Collection/MutableSetTest.php index 415d2643..8f19cc7e 100644 --- a/tests/unit/Collection/MutableSetTest.php +++ b/tests/unit/Collection/MutableSetTest.php @@ -109,7 +109,7 @@ public function testArrayAccess(): void static::assertTrue(isset($set['foo'])); static::assertSame('foo', $set['foo']); - + unset($set['foo']); static::assertFalse(isset($set['foo'])); @@ -191,6 +191,12 @@ public function testOffsetGetThrowsForInvalidOffsetType(): void $set[false]; } + public function testFromItems(): void + { + $set = MutableSet::fromItems(['a', 'b', 'b', 'c']); + static::assertSame(['a' => 'a', 'b' => 'b', 'c' => 'c'], $set->toArray()); + } + /** * @template T of array-key * diff --git a/tests/unit/Collection/MutableVectorTest.php b/tests/unit/Collection/MutableVectorTest.php index 10f34084..c8dd5bbc 100644 --- a/tests/unit/Collection/MutableVectorTest.php +++ b/tests/unit/Collection/MutableVectorTest.php @@ -236,7 +236,6 @@ public function testFromItems(): void static::assertSame([1, 2, 3], $vector->toArray()); } - /** * @template T * diff --git a/tests/unit/Collection/SetTest.php b/tests/unit/Collection/SetTest.php index fedc4f6e..2c2bef72 100644 --- a/tests/unit/Collection/SetTest.php +++ b/tests/unit/Collection/SetTest.php @@ -15,6 +15,18 @@ final class SetTest extends AbstractSetTest */ protected string $setClass = Set::class; + public function testFromItems(): void { + $set = Set::fromItems([ + 'foo', + 'bar', + 'baz', + ]); + + static::assertTrue($set->contains('foo')); + static::assertTrue($set->contains('bar')); + static::assertTrue($set->contains('baz')); + } + /** * @template T of array-key * diff --git a/tests/unit/Collection/VectorTest.php b/tests/unit/Collection/VectorTest.php index 24afb718..19087275 100644 --- a/tests/unit/Collection/VectorTest.php +++ b/tests/unit/Collection/VectorTest.php @@ -15,6 +15,12 @@ final class VectorTest extends AbstractVectorTest */ protected string $vectorClass = Vector::class; + public function testFromItems(): void + { + $vector = Vector::fromItems([1, 2, 3]); + static::assertSame([1, 2, 3], $vector->toArray()); + } + /** * @template T * From def70e0cbf1e67a74df4207769266c7f201d3ecc Mon Sep 17 00:00:00 2001 From: pfmmfp Date: Fri, 30 Aug 2024 16:57:02 -0300 Subject: [PATCH 3/7] add containsKey alias --- src/Psl/Collection/IndexAccessInterface.php | 11 +++++++++++ src/Psl/Collection/Map.php | 12 ++++++++++++ src/Psl/Collection/MutableMap.php | 12 ++++++++++++ src/Psl/Collection/MutableSet.php | 14 ++++++++++++++ src/Psl/Collection/MutableVector.php | 12 ++++++++++++ src/Psl/Collection/Set.php | 14 ++++++++++++++ src/Psl/Collection/Vector.php | 12 ++++++++++++ tests/unit/Collection/MutableMapTest.php | 3 ++- tests/unit/Collection/SetTest.php | 3 ++- 9 files changed, 91 insertions(+), 2 deletions(-) diff --git a/src/Psl/Collection/IndexAccessInterface.php b/src/Psl/Collection/IndexAccessInterface.php index 797d23cd..25940b84 100644 --- a/src/Psl/Collection/IndexAccessInterface.php +++ b/src/Psl/Collection/IndexAccessInterface.php @@ -34,6 +34,17 @@ public function at(int|string $k): mixed; */ public function contains(int|string $k): bool; + /** + * Alias of `contains`. + * + * @param Tk $k + * + * @see contains() method + * + * @psalm-mutation-free + */ + public function containsKey(int|string $k): bool; + /** * Returns the value at the specified key in the current collection. * diff --git a/src/Psl/Collection/Map.php b/src/Psl/Collection/Map.php index a4abb6ff..3f486fe6 100644 --- a/src/Psl/Collection/Map.php +++ b/src/Psl/Collection/Map.php @@ -253,6 +253,18 @@ public function contains(int|string $k): bool return array_key_exists($k, $this->elements); } + /** + * Alias of `contains`. + * + * @param Tk $k + * + * @psalm-mutation-free + */ + public function containsKey(int|string $k): bool + { + return $this->contains($k); + } + /** * Returns the value at the specified key in the current map. * diff --git a/src/Psl/Collection/MutableMap.php b/src/Psl/Collection/MutableMap.php index 12a4d102..7dd1d252 100644 --- a/src/Psl/Collection/MutableMap.php +++ b/src/Psl/Collection/MutableMap.php @@ -253,6 +253,18 @@ public function contains(int|string $k): bool return array_key_exists($k, $this->elements); } + /** + * Alias of `contains`. + * + * @param Tk $k + * + * @psalm-mutation-free + */ + public function containsKey(int|string $k): bool + { + return $this->contains($k); + } + /** * Returns the value at the specified key in the current map. * diff --git a/src/Psl/Collection/MutableSet.php b/src/Psl/Collection/MutableSet.php index f58c12bd..21eda1f6 100644 --- a/src/Psl/Collection/MutableSet.php +++ b/src/Psl/Collection/MutableSet.php @@ -233,6 +233,20 @@ public function contains(int|string $k): bool return array_key_exists($k, $this->elements); } + /** + * Alias of `contains`. + * + * @param T $k + * + * @return bool True if the value is in the set, false otherwise. + * + * @psalm-mutation-free + */ + public function containsKey(int|string $k): bool + { + return $this->contains($k); + } + /** * Returns the provided value if it is part of the set, or null if it is not. * diff --git a/src/Psl/Collection/MutableVector.php b/src/Psl/Collection/MutableVector.php index 26c465f0..76915ca0 100644 --- a/src/Psl/Collection/MutableVector.php +++ b/src/Psl/Collection/MutableVector.php @@ -204,6 +204,18 @@ public function contains(int|string $k): bool return array_key_exists($k, $this->elements); } + /** + * Alias of `contains`. + * + * @param int<0, max> $k + * + * @psalm-mutation-free + */ + public function containsKey(int|string $k): bool + { + return $this->contains($k); + } + /** * Returns the value at the specified key in the current `MutableVector`. * diff --git a/src/Psl/Collection/Set.php b/src/Psl/Collection/Set.php index 5d91a514..981b4785 100644 --- a/src/Psl/Collection/Set.php +++ b/src/Psl/Collection/Set.php @@ -236,6 +236,20 @@ public function contains(int|string $k): bool return array_key_exists($k, $this->elements); } + /** + * Alias of `contains`. + * + * @param T $k + * + * @return bool True if the value is in the set, false otherwise. + * + * @psalm-mutation-free + */ + public function containsKey(int|string $k): bool + { + return $this->contains($k); + } + /** * Returns the provided value if it is part of the set, or null if it is not. * diff --git a/src/Psl/Collection/Vector.php b/src/Psl/Collection/Vector.php index 964c14c4..1f4e9ba7 100644 --- a/src/Psl/Collection/Vector.php +++ b/src/Psl/Collection/Vector.php @@ -204,6 +204,18 @@ public function contains(int|string $k): bool return array_key_exists($k, $this->elements); } + /** + * Alias of `contains`. + * + * @param int<0, max> $k + * + * @psalm-mutation-free + */ + public function containsKey(int|string $k): bool + { + return $this->contains($k); + } + /** * Returns the value at the specified key in the current `Vector`. * diff --git a/tests/unit/Collection/MutableMapTest.php b/tests/unit/Collection/MutableMapTest.php index fce753be..df2ae468 100644 --- a/tests/unit/Collection/MutableMapTest.php +++ b/tests/unit/Collection/MutableMapTest.php @@ -235,7 +235,8 @@ public function testOffsetGetThrowsForInvalidOffsetType(): void $map[false]; } - public function testFromItems(): void { + public function testFromItems(): void + { $map = MutableMap::fromItems([ 'foo' => 'bar', 'bar' => 'baz', diff --git a/tests/unit/Collection/SetTest.php b/tests/unit/Collection/SetTest.php index 2c2bef72..015f5a7c 100644 --- a/tests/unit/Collection/SetTest.php +++ b/tests/unit/Collection/SetTest.php @@ -15,7 +15,8 @@ final class SetTest extends AbstractSetTest */ protected string $setClass = Set::class; - public function testFromItems(): void { + public function testFromItems(): void + { $set = Set::fromItems([ 'foo', 'bar', From 4ddf2a68841f52e180c6b8ef56766a17f14a8e04 Mon Sep 17 00:00:00 2001 From: pfmmfp Date: Mon, 2 Sep 2024 10:35:27 -0300 Subject: [PATCH 4/7] adding tests for containsKey --- tests/unit/Collection/AbstractMapTest.php | 3 ++- tests/unit/Collection/AbstractSetTest.php | 2 ++ tests/unit/Collection/AbstractVectorTest.php | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/unit/Collection/AbstractMapTest.php b/tests/unit/Collection/AbstractMapTest.php index de3aef1b..6e7ef4a0 100644 --- a/tests/unit/Collection/AbstractMapTest.php +++ b/tests/unit/Collection/AbstractMapTest.php @@ -555,8 +555,9 @@ public function testContains(): void ]); static::assertTrue($map->contains('foo')); + static::assertTrue($map->containsKey('foo')); static::assertTrue($map->contains('bar')); - static::assertFalse($map->contains('baz')); + static::assertFalse($map->containsKey('baz')); } public function testGet(): void diff --git a/tests/unit/Collection/AbstractSetTest.php b/tests/unit/Collection/AbstractSetTest.php index 759cc770..70fa28c4 100644 --- a/tests/unit/Collection/AbstractSetTest.php +++ b/tests/unit/Collection/AbstractSetTest.php @@ -484,8 +484,10 @@ public function testContains(): void ]); static::assertTrue($vector->contains('hello')); + static::assertTrue($vector->containsKey('hello')); static::assertTrue($vector->contains('world')); static::assertFalse($vector->contains('foo')); + static::assertFalse($vector->containsKey('foo')); } public function testGet(): void diff --git a/tests/unit/Collection/AbstractVectorTest.php b/tests/unit/Collection/AbstractVectorTest.php index 142696db..31c12ddf 100644 --- a/tests/unit/Collection/AbstractVectorTest.php +++ b/tests/unit/Collection/AbstractVectorTest.php @@ -529,7 +529,9 @@ public function testContains(): void static::assertTrue($vector->contains(0)); static::assertTrue($vector->contains(1)); + static::assertTrue($vector->containsKey(1)); static::assertFalse($vector->contains(2)); + static::assertFalse($vector->containsKey(2)); } public function testGet(): void From 367b57a5ed7d8bc9caf7d8c1e55dea5de8b6c307 Mon Sep 17 00:00:00 2001 From: pfmmfp Date: Mon, 2 Sep 2024 17:31:48 -0300 Subject: [PATCH 5/7] psalm types --- src/Psl/Collection/MutableSet.php | 9 +++++++-- src/Psl/Collection/MutableVector.php | 9 +++++++-- src/Psl/Collection/Set.php | 11 +++++++---- src/Psl/Collection/Vector.php | 9 +++++++-- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/Psl/Collection/MutableSet.php b/src/Psl/Collection/MutableSet.php index 21eda1f6..18a1aa2e 100644 --- a/src/Psl/Collection/MutableSet.php +++ b/src/Psl/Collection/MutableSet.php @@ -76,13 +76,18 @@ public static function fromArray(array $elements): MutableSet * * @template Ts of array-key * - * @param iterable $items + * @param iterable $items * * @return MutableSet */ public static function fromItems(iterable $items): MutableSet { - return self::fromArray(iterator_to_array($items)); + /** + * @psalm-suppress InvalidArgument + * @var array + */ + $array = iterator_to_array($items); + return self::fromArray($array); } /** diff --git a/src/Psl/Collection/MutableVector.php b/src/Psl/Collection/MutableVector.php index 76915ca0..bd550254 100644 --- a/src/Psl/Collection/MutableVector.php +++ b/src/Psl/Collection/MutableVector.php @@ -75,13 +75,18 @@ public static function fromArray(array $elements): MutableVector * * @template Ts * - * @param iterable $items + * @param iterable $items * * @return MutableVector */ public static function fromItems(iterable $items): MutableVector { - return self::fromArray(iterator_to_array($items)); + /** + * @psalm-suppress InvalidArgument + * @var array + */ + $array = iterator_to_array($items); + return self::fromArray($array); } /** diff --git a/src/Psl/Collection/Set.php b/src/Psl/Collection/Set.php index 981b4785..bd93ba82 100644 --- a/src/Psl/Collection/Set.php +++ b/src/Psl/Collection/Set.php @@ -77,15 +77,18 @@ public static function fromArray(array $elements): Set * * @template Ts of array-key * - * @param iterable $items + * @param iterable $items * * @return Set - * - * @pure */ public static function fromItems(iterable $items): Set { - return self::fromArray(iterator_to_array($items)); + /** + * @var array + * @psalm-suppress InvalidArgument + */ + $array = iterator_to_array($items); + return self::fromArray($array); } /** diff --git a/src/Psl/Collection/Vector.php b/src/Psl/Collection/Vector.php index 1f4e9ba7..3a1cf868 100644 --- a/src/Psl/Collection/Vector.php +++ b/src/Psl/Collection/Vector.php @@ -74,13 +74,18 @@ public static function fromArray(array $elements): Vector * * @template Ts * - * @param iterable $items + * @param iterable $items * * @return Vector */ public static function fromItems(iterable $items): Vector { - return self::fromArray(iterator_to_array($items)); + /** + * @psalm-suppress InvalidArgument + * @var array + */ + $array = iterator_to_array($items); + return self::fromArray($array); } /** From 228db7ea9ea11ade973859c12726e208a471587a Mon Sep 17 00:00:00 2001 From: pfmmfp Date: Tue, 3 Sep 2024 09:21:30 -0300 Subject: [PATCH 6/7] coding standards fix --- src/Psl/Collection/MutableSet.php | 1 + src/Psl/Collection/MutableVector.php | 1 + src/Psl/Collection/Set.php | 1 + src/Psl/Collection/Vector.php | 1 + 4 files changed, 4 insertions(+) diff --git a/src/Psl/Collection/MutableSet.php b/src/Psl/Collection/MutableSet.php index 18a1aa2e..7def68cb 100644 --- a/src/Psl/Collection/MutableSet.php +++ b/src/Psl/Collection/MutableSet.php @@ -84,6 +84,7 @@ public static function fromItems(iterable $items): MutableSet { /** * @psalm-suppress InvalidArgument + * * @var array */ $array = iterator_to_array($items); diff --git a/src/Psl/Collection/MutableVector.php b/src/Psl/Collection/MutableVector.php index bd550254..1ade1cc9 100644 --- a/src/Psl/Collection/MutableVector.php +++ b/src/Psl/Collection/MutableVector.php @@ -83,6 +83,7 @@ public static function fromItems(iterable $items): MutableVector { /** * @psalm-suppress InvalidArgument + * * @var array */ $array = iterator_to_array($items); diff --git a/src/Psl/Collection/Set.php b/src/Psl/Collection/Set.php index bd93ba82..c87c65d8 100644 --- a/src/Psl/Collection/Set.php +++ b/src/Psl/Collection/Set.php @@ -85,6 +85,7 @@ public static function fromItems(iterable $items): Set { /** * @var array + * * @psalm-suppress InvalidArgument */ $array = iterator_to_array($items); diff --git a/src/Psl/Collection/Vector.php b/src/Psl/Collection/Vector.php index 3a1cf868..83f6e557 100644 --- a/src/Psl/Collection/Vector.php +++ b/src/Psl/Collection/Vector.php @@ -82,6 +82,7 @@ public static function fromItems(iterable $items): Vector { /** * @psalm-suppress InvalidArgument + * * @var array */ $array = iterator_to_array($items); From 5a7d14457ef5f4637d11df29b87f968716c81c29 Mon Sep 17 00:00:00 2001 From: pfmmfp Date: Tue, 3 Sep 2024 09:22:51 -0300 Subject: [PATCH 7/7] documenter --- docs/component/collection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/component/collection.md b/docs/component/collection.md index 9a08d2c4..31a6317c 100644 --- a/docs/component/collection.md +++ b/docs/component/collection.md @@ -30,7 +30,7 @@ - [Map](./../../src/Psl/Collection/Map.php#L25) - [MutableMap](./../../src/Psl/Collection/MutableMap.php#L25) - [MutableSet](./../../src/Psl/Collection/MutableSet.php#L22) -- [MutableVector](./../../src/Psl/Collection/MutableVector.php#L23) +- [MutableVector](./../../src/Psl/Collection/MutableVector.php#L24) - [Set](./../../src/Psl/Collection/Set.php#L23) - [Vector](./../../src/Psl/Collection/Vector.php#L22)