diff --git a/src/Collection.php b/src/Collection.php index ae2da9a7e..4592f21a7 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -362,12 +362,12 @@ public static function fromGenerator(Generator $generator): CollectionInterface } /** - * @template NewTKey - * @template NewT + * @template UKey + * @template U * - * @param iterable $iterable + * @param iterable $iterable * - * @return self + * @return self */ public static function fromIterable(iterable $iterable): CollectionInterface { @@ -614,6 +614,9 @@ public function random(int $size = 1, ?int $seed = null): CollectionInterface return new self((new Operation\Random())()($seed ?? random_int(0, 1000))($size), [$this]); } + /** + * @return self + */ public static function range(float $start = 0.0, float $end = INF, float $step = 1.0): CollectionInterface { return new self((new Operation\Range())()($start)($end)($step)); @@ -756,6 +759,13 @@ public function takeWhile(callable ...$callbacks): CollectionInterface return new self((new Operation\TakeWhile())()(...$callbacks), [$this]); } + /** + * @template U + * + * @param callable(int): U $callback + * + * @return Collection + */ public static function times(int $number = 0, ?callable $callback = null): CollectionInterface { return new self((new Operation\Times())()($number)($callback));