66use Aeviiq \Collection \Exception \LogicException ;
77
88/**
9- * @psalm- template TKey as array-key
10- * @psalm- template TValue
9+ * @template TKey as array-key
10+ * @template TValue
1111 * @phpstan-template TKey
1212 * @phpstan-template TValue
1313 *
14- * @psalm- extends \IteratorAggregate<TKey, TValue>
15- * @psalm- extends \ArrayAccess<TKey, TValue>
14+ * @extends \IteratorAggregate<TKey, TValue>
15+ * @extends \ArrayAccess<TKey, TValue>
1616 * @phpstan-extends \IteratorAggregate<TKey, TValue>
1717 * @phpstan-extends \ArrayAccess<TKey, TValue>
1818 */
1919interface CollectionInterface extends SortableInterface, \IteratorAggregate, \ArrayAccess, \Countable
2020{
2121 /**
22- * @psalm-return array<TKey, TValue>
2322 * @phpstan-return array<TKey, TValue>
2423 *
2524 * @return array<string|int, mixed>
2625 */
2726 public function toArray (): array ;
2827
2928 /**
30- * @psalm-return TValue|null
3129 * @phpstan-return TValue|null
3230 *
3331 * @return mixed The first element in the collection or null if there is none.
3432 */
3533 public function first ();
3634
3735 /**
38- * @psalm-return TValue|null
3936 * @phpstan-return TValue|null
4037 *
4138 * @return mixed The last element in the collection or null if there is none.
4239 */
4340 public function last ();
4441
4542 /**
46- * @psalm-param TValue $element
4743 * @phpstan-param TValue $element
4844 *
4945 * @param mixed $element The value of the element you wish to remove.
@@ -52,15 +48,13 @@ public function last();
5248 public function remove ($ element ): void ;
5349
5450 /**
55- * @psalm-return array<TKey, mixed>
5651 * @phpstan-return array<TKey, mixed>
5752 *
5853 * @return array<string|int, mixed>
5954 */
6055 public function map (\Closure $ closure ): array ;
6156
6257 /**
63- * @psalm-return self<TKey, TValue>
6458 * @phpstan-return self<TKey, TValue>
6559 */
6660 public function filter (\Closure $ closure ): CollectionInterface ;
@@ -69,9 +63,6 @@ public function filter(\Closure $closure): CollectionInterface;
6963 * Merges the input with the collection. This can take an array with valid values or
7064 * an instance of the collection itself.
7165 *
72- * @psalm-param array<TKey, TValue>|self<TKey, TValue> $input
73- * @phpstan-param array<TKey, TValue>|self<TKey, TValue> $input
74- *
7566 * @param array<string|int, mixed>|CollectionInterface $input
7667 *
7768 * @throws InvalidArgumentException When the $input is not of the expected type(s).
@@ -84,7 +75,6 @@ public function merge($input): void;
8475 public function isEmpty (): bool ;
8576
8677 /**
87- * @psalm-param TValue $element
8878 * @phpstan-param TValue $element
8979 *
9080 * @param mixed $element
@@ -99,23 +89,20 @@ public function contains($element): bool;
9989 public function clear (): void ;
10090
10191 /**
102- * @psalm-return array<int, TKey>
10392 * @phpstan-return array<int, TKey>
10493 *
10594 * @return array<int, int|string>
10695 */
10796 public function getKeys (): array ;
10897
10998 /**
110- * @psalm-return array<int, TValue>
11199 * @phpstan-return array<int, TValue>
112100 *
113101 * @return array<int, mixed>
114102 */
115103 public function getValues (): array ;
116104
117105 /**
118- * @psalm-return TValue
119106 * @phpstan-return TValue
120107 *
121108 * @return mixed The one element that was found using the closure.
@@ -125,15 +112,13 @@ public function getValues(): array;
125112 public function getOneBy (\Closure $ closure );
126113
127114 /**
128- * @psalm-return TValue|null
129115 * @phpstan-return TValue|null
130116 *
131117 * @return mixed The one element that was found using the closure or null if none was found.
132118 */
133119 public function getOneOrNullBy (\Closure $ closure );
134120
135121 /**
136- * @psalm-param array<TKey, TValue> $elements
137122 * @phpstan-param array<TKey, TValue> $elements
138123 *
139124 * @param array<string|int, mixed> $elements
@@ -143,23 +128,20 @@ public function getOneOrNullBy(\Closure $closure);
143128 public function exchangeArray (array $ elements ): void ;
144129
145130 /**
146- * @psalm-param TValue $element
147131 * @phpstan-param TValue $element
148132 *
149133 * @param mixed $element
150134 */
151135 public function append ($ element ): void ;
152136
153137 /**
154- * @psalm-param class-string<ArrayAccess>|string $iteratorClass
155138 * @phpstan-param class-string<ArrayAccess>|string $iteratorClass
156139 *
157140 * @throws InvalidArgumentException When the given iterator class does not implement ArrayAccess.
158141 */
159142 public function setIteratorClass (string $ iteratorClass ): void ;
160143
161144 /**
162- * @psalm-return self<TKey, TValue>
163145 * @phpstan-return self<TKey, TValue>
164146 */
165147 public function copy (): CollectionInterface ;
0 commit comments