From 01e2ce5c0c363e7de3839dc629f59b66c267d9e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Fri, 13 Jan 2023 16:38:58 +0100 Subject: [PATCH] Fix: Avoid reassigning values to variables (#146) --- src/VersionParser.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/VersionParser.php b/src/VersionParser.php index 202ce247..c2eee6f3 100644 --- a/src/VersionParser.php +++ b/src/VersionParser.php @@ -260,16 +260,16 @@ public function parseConstraints($constraints) } $orGroups = array(); - foreach ($orConstraints as $constraints) { - $andConstraints = preg_split('{(?< ,]) *(?< ,]) *(? 1) { $constraintObjects = array(); - foreach ($andConstraints as $constraint) { - foreach ($this->parseConstraint($constraint) as $parsedConstraint) { - $constraintObjects[] = $parsedConstraint; + foreach ($andConstraints as $andConstraint) { + foreach ($this->parseConstraint($andConstraint) as $parsedAndConstraint) { + $constraintObjects[] = $parsedAndConstraint; } } } else { @@ -285,11 +285,11 @@ public function parseConstraints($constraints) $orGroups[] = $constraint; } - $constraint = MultiConstraint::create($orGroups, false); + $parsedConstraint = MultiConstraint::create($orGroups, false); - $constraint->setPrettyString($prettyConstraint); + $parsedConstraint->setPrettyString($prettyConstraint); - return $constraint; + return $parsedConstraint; } /**