Skip to content

Commit

Permalink
More specific return type for groupMapReduce
Browse files Browse the repository at this point in the history
  • Loading branch information
mavlitov98 committed Jun 15, 2022
1 parent b5895c5 commit 967946c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Fp/Functions/Collection/GroupMapReduce.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
* @param callable(A): B $map
* @param callable(B, B): B $reduce
* @return array<KOut, B>
*
* @psalm-return ($collection is non-empty-array
* ? non-empty-array<KOut, B>
* : array<KOut, B>)
*/
function groupMapReduce(iterable $collection, callable $group, callable $map, callable $reduce): array
{
Expand Down

0 comments on commit 967946c

Please sign in to comment.