diff --git a/src/Operation/Cycle.php b/src/Operation/Cycle.php index 9e33fe196..a3744220e 100644 --- a/src/Operation/Cycle.php +++ b/src/Operation/Cycle.php @@ -39,7 +39,7 @@ public function on(iterable $collection): Closure $length = $this->length; return static function () use ($collection, $length): Generator { - $cycleIterator = new LimitIterator( + $iterator = new LimitIterator( new InfiniteIterator( new IterableIterator($collection) ), @@ -47,7 +47,7 @@ public function on(iterable $collection): Closure $length ); - foreach ($cycleIterator as $value) { + foreach ($iterator as $value) { yield $value; } };