From 80d51e0d18f0ed0a5e9b74a9d338525fd477592d Mon Sep 17 00:00:00 2001 From: Stepan Anchugov Date: Fri, 22 Jan 2016 18:33:13 +0500 Subject: [PATCH] Sort bundles in config commands --- .../FrameworkBundle/Command/AbstractConfigCommand.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php index 232d62ffc9..711934c73a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php @@ -30,7 +30,13 @@ abstract class AbstractConfigCommand extends ContainerDebugCommand { $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() : ''); }