diff --git a/src/Composer/Repository/FilesystemRepository.php b/src/Composer/Repository/FilesystemRepository.php index ec37573f2..abb9f125e 100644 --- a/src/Composer/Repository/FilesystemRepository.php +++ b/src/Composer/Repository/FilesystemRepository.php @@ -329,6 +329,14 @@ REGEX; ksort($versions['versions']); ksort($versions); + foreach ($versions['versions'] as $name => $version) { + foreach (['aliases', 'replaced', 'provided'] as $key) { + if (isset($versions['versions'][$name][$key])) { + sort($versions['versions'][$name][$key], SORT_NATURAL); + } + } + } + return $versions; } diff --git a/tests/Composer/Test/Repository/Fixtures/installed.php b/tests/Composer/Test/Repository/Fixtures/installed.php index dbdda5e3c..3bfbc15ab 100644 --- a/tests/Composer/Test/Repository/Fixtures/installed.php +++ b/tests/Composer/Test/Repository/Fixtures/installed.php @@ -65,10 +65,10 @@ 'foo/impl' => array( 'dev_requirement' => false, 'provided' => array( - 0 => '^1.1', - 1 => '1.2', - 2 => '1.4', - 3 => '2.0', + 0 => '1.2', + 1 => '1.4', + 2 => '2.0', + 3 => '^1.1', ), ), 'foo/impl2' => array(