1
0
Fork 0

Formatting updates for PSR-2 compliance.

pull/1881/head
Sam Minnee 2013-05-12 16:36:34 +12:00
parent b25457a8c1
commit be9aae5bab
1 changed files with 23 additions and 14 deletions

View File

@ -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');