File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -478,10 +478,12 @@ public function skipWhile(callable $predicate): self
478
478
/**
479
479
* Reduces input values to a single value. Defaults to summation. This is a terminal operation.
480
480
*
481
+ * @template T
482
+ *
481
483
* @param ?callable $func function (mixed $carry, mixed $item) { must return updated $carry }
482
- * @param ?mixed $ initial initial value for a $carry
484
+ * @param T $initial The initial initial value for a $carry
483
485
*
484
- * @return ?mixed
486
+ * @return int|T
485
487
*/
486
488
public function reduce (?callable $ func = null , $ initial = null )
487
489
{
@@ -491,10 +493,12 @@ public function reduce(?callable $func = null, $initial = null)
491
493
/**
492
494
* Reduces input values to a single value. Defaults to summation. Requires an initial value. This is a terminal operation.
493
495
*
494
- * @param mixed $initial initial value for a $carry
496
+ * @template T
497
+ *
498
+ * @param T $initial initial value for a $carry
495
499
* @param ?callable $func function (mixed $carry, mixed $item) { must return updated $carry }
496
500
*
497
- * @return ?mixed
501
+ * @return T
498
502
*/
499
503
public function fold ($ initial , ?callable $ func = null )
500
504
{
You can’t perform that action at this time.
0 commit comments