protected function listBundles(OutputInterface $output)
 {
     $headers = array('Bundle name', 'Extension alias');
     $rows = array();
     foreach ($this->getContainer()->get('kernel')->getBundles() as $bundle) {
         $extension = $bundle->getContainerExtension();
         $rows[] = array($bundle->getName(), $extension ? $extension->getAlias() : '');
     }
     $message = 'Available registered bundles with their extension alias if available:';
     if ($output instanceof StyleInterface) {
         $output->writeln(' ' . $message);
         $output->table($headers, $rows);
     } else {
         $output->writeln($message);
         $table = new Table($output);
         $table->setHeaders($headers)->setRows($rows)->render($output);
     }
 }