Skip to content

Commit

Permalink
minor #47299 [Console] fix expected command name order with mixed int…
Browse files Browse the repository at this point in the history
…eger and string namespaces (xabbuh)

This PR was merged into the 5.4 branch.

Discussion
----------

[Console] fix expected command name order with mixed integer and string namespaces

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

5cd0eae5af fix expected command name order with mixed integer and string namespaces
  • Loading branch information
nicolas-grekas committed Aug 17, 2022
1 parent c35fafd commit 28b7797
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Descriptor/ApplicationDescription.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private function sortCommands(array $commands): array
}

if ($namespacedCommands) {
ksort($namespacedCommands);
ksort($namespacedCommands, \SORT_STRING);
foreach ($namespacedCommands as $key => $commandsSet) {
ksort($commandsSet);
$sortedCommands[$key] = $commandsSet;
Expand Down
2 changes: 1 addition & 1 deletion Tests/Descriptor/ApplicationDescriptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function getNamespacesProvider()
return [
[['_global'], ['foobar']],
[['a', 'b'], ['b:foo', 'a:foo', 'b:bar']],
[['_global', 'b', 'z', 22, 33], ['z:foo', '1', '33:foo', 'b:foo', '22:foo:bar']],
[['_global', 22, 33, 'b', 'z'], ['z:foo', '1', '33:foo', 'b:foo', '22:foo:bar']],
];
}
}
Expand Down

0 comments on commit 28b7797

Please sign in to comment.