Skip to content

Commit

Permalink
fix(vec): reproduce and range return type is always non-empty-list (
Browse files Browse the repository at this point in the history
  • Loading branch information
dragosprotung authored and azjezz committed Dec 20, 2022
1 parent 0899aa8 commit 3ce5e7a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/component/vec.md
Expand Up @@ -29,7 +29,7 @@
- [partition](./../../src/Psl/Vec/partition.php#L20)
- [range](./../../src/Psl/Vec/range.php#L49)
- [reductions](./../../src/Psl/Vec/reductions.php#L29)
- [reproduce](./../../src/Psl/Vec/reproduce.php#L24)
- [reproduce](./../../src/Psl/Vec/reproduce.php#L27)
- [reverse](./../../src/Psl/Vec/reverse.php#L22)
- [shuffle](./../../src/Psl/Vec/shuffle.php#L26)
- [slice](./../../src/Psl/Vec/slice.php#L26)
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Vec/range.php
Expand Up @@ -36,7 +36,7 @@
*
* @throws Exception\LogicException If $start < $end, and $step is negative.
*
* @return list<T>
* @return non-empty-list<T>
*
* @psalm-suppress InvalidReturnType
* @psalm-suppress InvalidReturnStatement
Expand Down
5 changes: 4 additions & 1 deletion src/Psl/Vec/reproduce.php
Expand Up @@ -19,7 +19,10 @@
* @param positive-int $size
* @param (Closure(int): T) $factory
*
* @return list<T>
* @return non-empty-list<T>
*
* @psalm-suppress InvalidReturnType
* @psalm-suppress InvalidReturnStatement
*/
function reproduce(int $size, Closure $factory): array
{
Expand Down

0 comments on commit 3ce5e7a

Please sign in to comment.