Sort bundles in config commands

This commit is contained in:
Stepan Anchugov 2016-01-22 18:33:13 +05:00
parent 15c37c2442
commit 80d51e0d18
1 changed files with 7 additions and 1 deletions

View File

@ -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() : '');
}