Skip to content

Commit

Permalink
Update the ::iterate() static method.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Sep 14, 2019
1 parent 48dfce7 commit debec59
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion spec/drupol/collection/CollectionSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ public function it_can_iterate(): void
})
->limit(10)
->all()
->shouldReturn([0, 1, 1, 2, 3, 5, 8, 13, 21, 34]);
->shouldReturn([1, 1, 2, 3, 5, 8, 13, 21, 34, 55]);
}

public function it_can_keys(): void
Expand Down
4 changes: 0 additions & 4 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,6 @@ public static function iterate(callable $callback, ...$parameters): CollectionIn
{
return new Collection(
static function () use ($parameters, $callback) {
if ([] !== $parameters) {
yield $parameters;
}

while (true) {
$parameters = $callback(...$parameters);

Expand Down

0 comments on commit debec59

Please sign in to comment.