diff --git a/src/Operation/Cycle.php b/src/Operation/Cycle.php index 5dc302586..f4d0e4d2b 100644 --- a/src/Operation/Cycle.php +++ b/src/Operation/Cycle.php @@ -36,7 +36,7 @@ static function (Iterator $iterator, int $length): Generator { return yield from []; } - yield from new LimitIterator( + return yield from new LimitIterator( new InfiniteIterator($iterator), 0, $length diff --git a/src/Operation/Explode.php b/src/Operation/Explode.php index 9531befe3..ad41cc1d7 100644 --- a/src/Operation/Explode.php +++ b/src/Operation/Explode.php @@ -36,7 +36,7 @@ public function __invoke(): Closure * @psalm-return \Generator> */ static function (Iterator $iterator, array $explodes): Generator { - yield from (new Run( + return yield from (new Run( new Split( ...array_map( /** diff --git a/src/Operation/Limit.php b/src/Operation/Limit.php index befe390c0..825566e07 100644 --- a/src/Operation/Limit.php +++ b/src/Operation/Limit.php @@ -34,7 +34,7 @@ public function __invoke(): Closure * @psalm-return \Generator */ static function (Iterator $iterator, int $limit, int $offset): Generator { - yield from new LimitIterator($iterator, $offset, $limit); + return yield from new LimitIterator($iterator, $offset, $limit); }; } } diff --git a/src/Operation/Random.php b/src/Operation/Random.php index f5ebcbfea..fefd570b5 100644 --- a/src/Operation/Random.php +++ b/src/Operation/Random.php @@ -33,7 +33,7 @@ public function __invoke(): Closure * @psalm-return \Generator */ static function (Iterator $iterator, int $size): Generator { - yield from (new Run(new Limit($size), new Shuffle()))($iterator); + return yield from (new Run(new Limit($size), new Shuffle()))($iterator); }; } }