From 8ae26f6aa15a52afc3c99ec89d13c0b1170bc0de Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 8 Sep 2020 19:01:05 +0200 Subject: [PATCH] Remove unneeded variable assignations. --- src/Operation/Contains.php | 2 +- src/Operation/Falsy.php | 2 +- src/Operation/Nullsy.php | 2 +- src/Operation/Truthy.php | 2 +- src/Operation/Unpack.php | 2 +- src/Operation/Unwrap.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Operation/Contains.php b/src/Operation/Contains.php index e2fc4ce42..555b5175a 100644 --- a/src/Operation/Contains.php +++ b/src/Operation/Contains.php @@ -29,7 +29,7 @@ static function (...$values): Closure { * @psalm-return Generator */ static function (Iterator $iterator) use ($values): Generator { - foreach ($iterator as $key => $value) { + foreach ($iterator as $value) { foreach ($values as $k => $v) { if ($v === $value) { unset($values[$k]); diff --git a/src/Operation/Falsy.php b/src/Operation/Falsy.php index e6475ea03..832ba6128 100644 --- a/src/Operation/Falsy.php +++ b/src/Operation/Falsy.php @@ -26,7 +26,7 @@ public function __invoke(): Closure * @psalm-return Generator $iterator */ static function (Iterator $iterator): Generator { - foreach ($iterator as $key => $value) { + foreach ($iterator as $value) { if (false !== (bool) $value) { return yield false; } diff --git a/src/Operation/Nullsy.php b/src/Operation/Nullsy.php index 34a817d58..12134390f 100644 --- a/src/Operation/Nullsy.php +++ b/src/Operation/Nullsy.php @@ -26,7 +26,7 @@ public function __invoke(): Closure * @psalm-return Generator */ static function (Iterator $iterator): Generator { - foreach ($iterator as $key => $value) { + foreach ($iterator as $value) { if (null !== $value) { return yield false; } diff --git a/src/Operation/Truthy.php b/src/Operation/Truthy.php index 18b0a1af6..65b1757c3 100644 --- a/src/Operation/Truthy.php +++ b/src/Operation/Truthy.php @@ -26,7 +26,7 @@ public function __invoke(): Closure * @psalm-return Generator $iterator */ static function (Iterator $iterator): Generator { - foreach ($iterator as $key => $value) { + foreach ($iterator as $value) { if (false === (bool) $value) { return yield false; } diff --git a/src/Operation/Unpack.php b/src/Operation/Unpack.php index 40aa3e400..7bc5d0bfe 100644 --- a/src/Operation/Unpack.php +++ b/src/Operation/Unpack.php @@ -25,7 +25,7 @@ public function __invoke(): Closure * @psalm-return Generator */ static function (Iterator $iterator): Generator { - foreach ($iterator as $key => $value) { + foreach ($iterator as $value) { if (!is_iterable($value)) { continue; } diff --git a/src/Operation/Unwrap.php b/src/Operation/Unwrap.php index bab91c645..cb2427f46 100644 --- a/src/Operation/Unwrap.php +++ b/src/Operation/Unwrap.php @@ -27,7 +27,7 @@ public function __invoke(): Closure * @psalm-return Generator */ static function (Iterator $iterator): Generator { - foreach ($iterator as $key => $value) { + foreach ($iterator as $value) { foreach ((array) $value as $k => $v) { yield $k => $v; }