Skip to content

Commit 967946c

Browse files
committed
More specific return type for groupMapReduce
1 parent b5895c5 commit 967946c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Fp/Functions/Collection/GroupMapReduce.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
* @param callable(A): B $map
3737
* @param callable(B, B): B $reduce
3838
* @return array<KOut, B>
39+
*
40+
* @psalm-return ($collection is non-empty-array
41+
* ? non-empty-array<KOut, B>
42+
* : array<KOut, B>)
3943
*/
4044
function groupMapReduce(iterable $collection, callable $group, callable $map, callable $reduce): array
4145
{

0 commit comments

Comments
 (0)