Skip to content

Commit

Permalink
update SA annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Nov 27, 2022
1 parent d7bba3a commit 0e8b0e5
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,12 @@ public static function fromGenerator(Generator $generator): CollectionInterface
}

/**
* @template NewTKey
* @template NewT
* @template UKey
* @template U
*
* @param iterable<NewTKey, NewT> $iterable
* @param iterable<UKey, U> $iterable
*
* @return self<NewTKey, NewT>
* @return self<UKey, U>
*/
public static function fromIterable(iterable $iterable): CollectionInterface
{
Expand Down Expand Up @@ -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<int, float>
*/
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));
Expand Down Expand Up @@ -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<int, U>
*/
public static function times(int $number = 0, ?callable $callback = null): CollectionInterface
{
return new self((new Operation\Times())()($number)($callback));
Expand Down

0 comments on commit 0e8b0e5

Please sign in to comment.