@@ -17,9 +17,6 @@ final class Collection implements \ArrayAccess, \Countable, \IteratorAggregate
1717 */
1818 private array $ items ;
1919
20- /**
21- * @param mixed $items
22- */
2320 public function __construct ($ items = [])
2421 {
2522 $ this ->items = $ this ->getArrayableItems ($ items );
@@ -30,12 +27,6 @@ public function all(): array
3027 return $ this ->items ;
3128 }
3229
33- /**
34- * @param mixed $key
35- * @param mixed $default
36- *
37- * @return mixed
38- */
3930 public function get ($ key , $ default = null )
4031 {
4132 if (array_key_exists ($ key , $ this ->items )) {
@@ -151,10 +142,6 @@ public function unique($key = null, bool $strict = false)
151142
152143 /**
153144 * Get the first item from the collection passing the given truth test.
154- *
155- * @param mixed $default
156- *
157- * @return mixed
158145 */
159146 public function first (callable $ callback = null , $ default = null )
160147 {
@@ -181,27 +168,18 @@ public function first(callable $callback = null, $default = null)
181168 * Get the first item by the given key value pair.
182169 *
183170 * @param string $key
184- * @param mixed $operator
185- * @param mixed $value
186- *
187- * @return mixed
188171 */
189172 public function firstWhere ($ key , $ operator = null , $ value = null )
190173 {
191174 return $ this ->first ($ this ->operatorForWhere (...func_get_args ()));
192175 }
193176
194- /**
195- * @param mixed $offset
196- */
197177 public function offsetExists ($ offset ): bool
198178 {
199179 return isset ($ this ->items [$ offset ]);
200180 }
201181
202182 /**
203- * @param mixed $offset
204- *
205183 * @return mixed
206184 */
207185 #[\ReturnTypeWillChange]
@@ -210,10 +188,6 @@ public function offsetGet($offset)
210188 return $ this ->items [$ offset ];
211189 }
212190
213- /**
214- * @param mixed $offset
215- * @param mixed $value
216- */
217191 public function offsetSet ($ offset , $ value ): void
218192 {
219193 if (is_null ($ offset )) {
@@ -223,9 +197,6 @@ public function offsetSet($offset, $value): void
223197 }
224198 }
225199
226- /**
227- * @param mixed $offset
228- */
229200 public function offsetUnset ($ offset ): void
230201 {
231202 unset($ this ->items [$ offset ]);
@@ -241,9 +212,6 @@ public function getIterator(): \ArrayIterator
241212 return new \ArrayIterator ($ this ->items );
242213 }
243214
244- /**
245- * @param mixed $items
246- */
247215 private function getArrayableItems ($ items ): array
248216 {
249217 if (is_array ($ items )) {
@@ -269,9 +237,6 @@ private function getArrayableItems($items): array
269237 return (array ) $ items ;
270238 }
271239
272- /**
273- * @param mixed $value
274- */
275240 private function useAsCallable ($ value ): bool
276241 {
277242 return !is_string ($ value ) && is_callable ($ value );
@@ -292,11 +257,7 @@ private function valueRetriever($value)
292257 }
293258
294259 /**
295- * @param mixed $target
296260 * @param string|array|int|null $key
297- * @param mixed $default
298- *
299- * @return mixed
300261 */
301262 private static function getDeepData ($ target , $ key , $ default = null )
302263 {
@@ -358,9 +319,6 @@ public static function arrayCollapse(iterable $array): array
358319 return array_merge ([], ...$ results );
359320 }
360321
361- /**
362- * @param mixed $value
363- */
364322 public static function accessible ($ value ): bool
365323 {
366324 return is_array ($ value ) || $ value instanceof \ArrayAccess;
@@ -381,10 +339,7 @@ private static function existsInArray($array, $key): bool
381339 return array_key_exists ($ key , $ array );
382340 }
383341
384- /**
385- * @param mixed $value
386- */
387- private function operatorForWhere (string $ key , ?string $ operator = null , $ value = null ): \Closure
342+ private function operatorForWhere (string $ key , string $ operator = null , $ value = null ): \Closure
388343 {
389344 if (1 === func_num_args ()) {
390345 $ value = true ;
0 commit comments