|
@@ -234,6 +234,13 @@ class VersionParser
|
|
|
|
|
|
private function parseConstraint($constraint)
|
|
|
{
|
|
|
+ if (preg_match('{^([^,\s]+?)@('.implode('|', array_keys(BasePackage::$stabilities)).')$}i', $constraint, $match)) {
|
|
|
+ $constraint = $match[1];
|
|
|
+ if ($match[2] !== 'stable') {
|
|
|
+ $stabilityModifier = $match[2];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (preg_match('{^[x*](\.[x*])*$}i', $constraint)) {
|
|
|
return array();
|
|
|
}
|
|
@@ -274,6 +281,10 @@ class VersionParser
|
|
|
try {
|
|
|
$version = $this->normalize($matches[2]);
|
|
|
|
|
|
+ if (!empty($stabilityModifier) && $this->parseStability($version) === 'stable') {
|
|
|
+ $version .= '-' . $stabilityModifier;
|
|
|
+ }
|
|
|
+
|
|
|
return array(new VersionConstraint($matches[1] ?: '=', $version));
|
|
|
} catch (\Exception $e) {}
|
|
|
}
|