Sort bundles in config commands
This commit is contained in:
parent
15c37c2442
commit
80d51e0d18
@ -30,7 +30,13 @@ abstract class AbstractConfigCommand extends ContainerDebugCommand
|
|||||||
{
|
{
|
||||||
$headers = array('Bundle name', 'Extension alias');
|
$headers = array('Bundle name', 'Extension alias');
|
||||||
$rows = array();
|
$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();
|
$extension = $bundle->getContainerExtension();
|
||||||
$rows[] = array($bundle->getName(), $extension ? $extension->getAlias() : '');
|
$rows[] = array($bundle->getName(), $extension ? $extension->getAlias() : '');
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user