From 119cdfeb092b31970eac5a98f56e52d4f4ee8e69 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Sat, 15 Aug 2020 23:02:15 +0200 Subject: [PATCH] Add missing return statements. --- src/Operation/Cycle.php | 2 +- src/Operation/Explode.php | 2 +- src/Operation/Limit.php | 2 +- src/Operation/Random.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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); }; } }