@@ -332,6 +332,10 @@ public static function pick(array &$array, string|int $key, mixed $default = nul
332
332
/**
333
333
* Tests whether at least one element in the array passes the test implemented by the
334
334
* provided callback with signature `function ($value, $key, array $array): bool`.
335
+ * @template K
336
+ * @template V
337
+ * @param iterable<K, V> $array
338
+ * @param callable(V, K, ($array is array ? array<K, V> : iterable<K, V>)): bool $callback
335
339
*/
336
340
public static function some (iterable $ array , callable $ callback ): bool
337
341
{
@@ -348,6 +352,10 @@ public static function some(iterable $array, callable $callback): bool
348
352
/**
349
353
* Tests whether all elements in the array pass the test implemented by the provided function,
350
354
* which has the signature `function ($value, $key, array $array): bool`.
355
+ * @template K
356
+ * @template V
357
+ * @param iterable<K, V> $array
358
+ * @param callable(V, K, ($array is array ? array<K, V> : iterable<K, V>)): bool $callback
351
359
*/
352
360
public static function every (iterable $ array , callable $ callback ): bool
353
361
{
@@ -364,6 +372,12 @@ public static function every(iterable $array, callable $callback): bool
364
372
/**
365
373
* Calls $callback on all elements in the array and returns the array of return values.
366
374
* The callback has the signature `function ($value, $key, array $array): bool`.
375
+ * @template K of array-key
376
+ * @template V
377
+ * @template R
378
+ * @param iterable<K, V> $array
379
+ * @param callable(V, K, ($array is array ? array<K, V> : iterable<K, V>)): R $callback
380
+ * @return array<K, R>
367
381
*/
368
382
public static function map (iterable $ array , callable $ callback ): array
369
383
{
0 commit comments