1
0
Fork 0

Update ranges for 0.N versions, refs #3518

pull/3522/head
Jordi Boggiano 2014-12-08 17:04:59 +00:00
parent 9438f3a58f
commit 06e96a78e2
2 changed files with 4 additions and 4 deletions

View File

@ -109,11 +109,11 @@ class VersionSelector
if (count($semanticVersionParts) == 4 && preg_match('{^0\D?}', $semanticVersionParts[3])) {
// remove the last parts (i.e. the patch version number and any extra)
if ($semanticVersionParts[0] === '0') {
if ($semanticVersionParts[2] === '0') {
if ($semanticVersionParts[1] === '0') {
$semanticVersionParts[3] = '*';
} else {
$semanticVersionParts[2] = '*';
unset($semanticVersionParts[3]);
} else {
$semanticVersionParts[3] = '*';
}
$op = '';
} else {

View File

@ -99,7 +99,7 @@ class VersionSelectorTest extends \PHPUnit_Framework_TestCase
array('3.1.2-pl2', false, 'stable', '~3.1'),
array('3.1.2-patch', false, 'stable', '~3.1'),
array('0.1.0', false, 'stable', '0.1.*'),
array('0.1.3', false, 'stable', '0.1.3.*'),
array('0.1.3', false, 'stable', '0.1.*'),
array('0.0.3', false, 'stable', '0.0.3.*'),
array('0.0.3-alpha', false, 'alpha', '0.0.3.*@alpha'),
array('2.0-beta.1', false, 'beta', '~2.0@beta'),