Skip to content

Commit bdcc77f

Browse files
committed
Sort bundles in config commands
1 parent efed0cb commit bdcc77f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Command/AbstractConfigCommand.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ protected function listBundles(OutputInterface $output)
3030
{
3131
$headers = array('Bundle name', 'Extension alias');
3232
$rows = array();
33-
foreach ($this->getContainer()->get('kernel')->getBundles() as $bundle) {
33+
34+
$bundles = $this->getContainer()->get('kernel')->getBundles();
35+
usort($bundles, function($bundleA, $bundleB) {
36+
return strcmp($bundleA->getName(), $bundleB->getName());
37+
});
38+
39+
foreach ($bundles as $bundle) {
3440
$extension = $bundle->getContainerExtension();
3541
$rows[] = array($bundle->getName(), $extension ? $extension->getAlias() : '');
3642
}

0 commit comments

Comments
 (0)