Skip to content

Commit

Permalink
Sort bundles in config commands
Browse files Browse the repository at this point in the history
  • Loading branch information
kix committed Jan 22, 2016
1 parent 15c37c2 commit 80d51e0
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ protected function listBundles(OutputInterface $output)
{
$headers = array('Bundle name', 'Extension alias');
$rows = array();
foreach ($this->getContainer()->get('kernel')->getBundles() as $bundle) {

$bundles = $this->getContainer()->get('kernel')->getBundles();
usort($bundles, function($bundleA, $bundleB) {
return strcmp($bundleA->getName(), $bundleB->getName());
});

foreach ($bundles as $bundle) {
$extension = $bundle->getContainerExtension();
$rows[] = array($bundle->getName(), $extension ? $extension->getAlias() : '');
}
Expand Down

0 comments on commit 80d51e0

Please sign in to comment.