diff --git a/Converter/SemverConverter.php b/Converter/SemverConverter.php index 91511d1e..8b61727a 100644 --- a/Converter/SemverConverter.php +++ b/Converter/SemverConverter.php @@ -55,13 +55,15 @@ public function convertRange($range) */ protected function cleanRange($range) { - foreach (array('<', '>', '=', '~', '^', '||') as $character) { + foreach (array('<', '>', '=', '~', '^', '||', '&&') as $character) { $range = str_replace($character.' ', $character, $range); } $range = preg_replace('/(?:[vV])(\d+)/', '${1}', $range); + $range = str_replace(' ||', '||', $range); + $range = str_replace(array(' &&', '&&'), ',', $range); - return str_replace(' ||', '||', $range); + return $range; } /** diff --git a/Tests/Converter/SemverConverterTest.php b/Tests/Converter/SemverConverterTest.php index b4b500e7..197a1e6c 100644 --- a/Tests/Converter/SemverConverterTest.php +++ b/Tests/Converter/SemverConverterTest.php @@ -134,6 +134,7 @@ public function getTestRanges() array('>=1.2 <2.0', '>=1.2,<2.0'), array('>=1 <2', '>=1,<2'), array('>=1.0 <1.1 || >=1.2', '>=1.0,<1.1|>=1.2'), + array('>=1.0 && <1.1 || >=1.2', '>=1.0,<1.1|>=1.2'), array('< 1.2.3', '<1.2.3'), array('> 1.2.3', '>1.2.3'), array('<= 1.2.3', '<=1.2.3'),