We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d99682 commit 09aeff9Copy full SHA for 09aeff9
src/iterable-functions.php
@@ -15,13 +15,18 @@
15
/**
16
* Maps a callable to an iterable.
17
*
18
- * @param iterable<mixed> $iterable
+ * @param iterable<TKey, TValue> $iterable
19
+ * @param callable(TValue):TResult $mapper
20
- * @return iterable<mixed>
21
+ * @return iterable<TKey, TResult>
22
+ *
23
+ * @template TKey
24
+ * @template TValue
25
+ * @template TResult
26
*/
-function iterable_map(iterable $iterable, callable $map): iterable
27
+function iterable_map(iterable $iterable, callable $mapper): iterable
28
{
- $mapped = iterable($iterable)->map($map);
29
+ $mapped = iterable($iterable)->map($mapper);
30
31
return is_array($iterable) ? $mapped->asArray() : $mapped;
32
}
0 commit comments