Skip to content

Commit 5d99682

Browse files
authored
Chore: Add types to iterable_reduce() (#31)
1 parent 7b3e19b commit 5d99682

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/iterable-functions.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,16 @@ function iterable_filter(iterable $iterable, ?callable $filter = null): iterable
8484
/**
8585
* Reduces an iterable.
8686
*
87-
* @param iterable<mixed> $iterable
88-
* @param callable(mixed, mixed):mixed $reduce
87+
* @param iterable<TValue> $iterable
88+
* @param callable(TResult|null, TValue):TResult $reduce
89+
* @param TResult|null $initial
8990
*
90-
* @return mixed
91+
* @return TResult|null
9192
*
92-
* @psalm-template TValue
93+
* @template TValue
9394
* @template TResult
94-
* @psalm-param iterable<TValue> $iterable
95-
* @psalm-param callable(TResult|null, TValue):TResult $reduce
96-
* @psalm-param TResult|null $initial
97-
* @psalm-return TResult|null
95+
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
96+
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint
9897
*/
9998
function iterable_reduce(iterable $iterable, callable $reduce, $initial = null)
10099
{

0 commit comments

Comments
 (0)