Formatting updates for PSR-2 compliance.
parent
b25457a8c1
commit
be9aae5bab
|
@ -277,10 +277,15 @@ class VersionParser
|
|||
if (preg_match('{^~(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.(\d+))?'.self::$modifierRegex.'?$}i', $constraint, $matches)) {
|
||||
|
||||
// Work out which position in the version we are operating at
|
||||
if (isset($matches[4]) && '' !== $matches[4]) $position = 4;
|
||||
else if (isset($matches[3]) && '' !== $matches[3]) $position = 3;
|
||||
else if (isset($matches[2]) && '' !== $matches[2]) $position = 2;
|
||||
else $position = 1;
|
||||
if (isset($matches[4]) && '' !== $matches[4]) {
|
||||
$position = 4;
|
||||
} elseif (isset($matches[3]) && '' !== $matches[3]) {
|
||||
$position = 3;
|
||||
} elseif (isset($matches[2]) && '' !== $matches[2]) {
|
||||
$position = 2;
|
||||
} else {
|
||||
$position = 1;
|
||||
}
|
||||
|
||||
// Calculate the stability suffix
|
||||
$stabilitySuffix = '';
|
||||
|
@ -317,9 +322,13 @@ class VersionParser
|
|||
|
||||
// match wildcard constraints
|
||||
if (preg_match('{^(\d+)(?:\.(\d+))?(?:\.(\d+))?\.[x*]$}', $constraint, $matches)) {
|
||||
if (isset($matches[3]) && '' !== $matches[3]) $position = 3;
|
||||
else if (isset($matches[2]) && '' !== $matches[2]) $position = 2;
|
||||
else $position = 1;
|
||||
if (isset($matches[3]) && '' !== $matches[3]) {
|
||||
$position = 3;
|
||||
} elseif (isset($matches[2]) && '' !== $matches[2]) {
|
||||
$position = 2;
|
||||
} else {
|
||||
$position = 1;
|
||||
}
|
||||
|
||||
$highVersion = $this->manipulateVersionString($matches, $position, 0, '9999999');
|
||||
$lowVersion = $this->manipulateVersionString($matches, $position, -1, '9999999');
|
||||
|
|
Loading…
Reference in New Issue