1
0
Fork 0

Use natural sort to sort packages, refs #3872

pull/3991/head
Jordi Boggiano 2015-05-01 16:16:02 +01:00
parent 06fb00bfe5
commit ab02867015
2 changed files with 5 additions and 5 deletions

View File

@ -137,7 +137,7 @@ class JsonManipulator
}; };
uksort($packages, function ($a, $b) use ($prefix) { uksort($packages, function ($a, $b) use ($prefix) {
return strcmp($prefix($a), $prefix($b)); return strnatcmp($prefix($a), $prefix($b));
}); });
} }

View File

@ -336,8 +336,8 @@ class JsonManipulatorTest extends \PHPUnit_Framework_TestCase
'{ '{
"require": { "require": {
"foo": "baz", "foo": "baz",
"ext-mcrypt": "*", "ext-10gd": "*",
"ext-gd": "*", "ext-2mcrypt": "*",
"lib-foo": "*", "lib-foo": "*",
"hhvm": "*", "hhvm": "*",
"php": ">=5.5" "php": ">=5.5"
@ -351,8 +351,8 @@ class JsonManipulatorTest extends \PHPUnit_Framework_TestCase
"require": { "require": {
"php": ">=5.5", "php": ">=5.5",
"hhvm": "*", "hhvm": "*",
"ext-gd": "*", "ext-2mcrypt": "*",
"ext-mcrypt": "*", "ext-10gd": "*",
"lib-foo": "*", "lib-foo": "*",
"foo": "baz", "foo": "baz",
"igorw/retry": "*" "igorw/retry": "*"