Merge pull request #3583 from stof/complex_stability_flag_issue
Fix the parsing of stability flags on complex constraintspull/3472/merge
commit
4569f528f6
|
@ -131,7 +131,7 @@ class RootPackageLoader extends ArrayLoader
|
|||
$minimumStability = $stabilities[$minimumStability];
|
||||
foreach ($requires as $reqName => $reqVersion) {
|
||||
// parse explicit stability flags to the most unstable
|
||||
if (preg_match('{^[^,\s]*?@('.implode('|', array_keys($stabilities)).')$}i', $reqVersion, $match)) {
|
||||
if (preg_match('{^[^@]*?@('.implode('|', array_keys($stabilities)).')$}i', $reqVersion, $match)) {
|
||||
$name = strtolower($reqName);
|
||||
$stability = $stabilities[VersionParser::normalizeStability($match[1])];
|
||||
|
||||
|
|
|
@ -143,6 +143,7 @@ class RootPackageLoaderTest extends \PHPUnit_Framework_TestCase
|
|||
'foo/bar' => '~2.1.0-beta2',
|
||||
'bar/baz' => '1.0.x-dev as 1.2.0',
|
||||
'qux/quux' => '1.0.*@rc',
|
||||
'zux/complex' => '~1.0,>=1.0.2@dev'
|
||||
),
|
||||
'minimum-stability' => 'alpha',
|
||||
));
|
||||
|
@ -151,6 +152,7 @@ class RootPackageLoaderTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertEquals(array(
|
||||
'bar/baz' => BasePackage::STABILITY_DEV,
|
||||
'qux/quux' => BasePackage::STABILITY_RC,
|
||||
'zux/complex' => BasePackage::STABILITY_DEV,
|
||||
), $package->getStabilityFlags());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue