8000 handle inheritance in config:dump-reference when a bundle name is pas… · symfony/symfony@cdfbe72 · GitHub
[go: up one dir, main page]

Skip to content

Commit cdfbe72

Browse files
committed
handle inheritance in config:dump-reference when a bundle name is passed to the command
1 parent de958c7 commit cdfbe72

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected function configure()
6262
protected function execute(InputInterface $input, OutputInterface $output)
6363
{
6464
$this->output = $output;
65-
$kernel = $this->getContainer()->get('kernel');
65+
$bundles = $this->getContainer()->get('kernel')->getBundles();
6666
$containerBuilder = $this->getContainerBuilder();
6767

6868
$name = $input->getArgument('name');
@@ -71,15 +71,18 @@ protected function execute(InputInterface $input, OutputInterface $output)
7171

7272
if (preg_match('/Bundle$/', $name)) {
7373
// input is bundle name
74-
$extension = $kernel->getBundle($name)->getContainerExtension();
74+
75+
if (isset($bundles[$name])) {
76+
$extension = $bundles[$name]->getContainerExtension();
77+
}
7578

7679
if (!$extension) {
7780
throw new \LogicException('No extensions with configuration available for "'.$name.'"');
7881
}
7982

8083
$message = 'Default configuration for "'.$name.'"';
8184
} else {
82-
foreach ($kernel->getBundles() as $bundle) {
85+
foreach ($bundles as $bundle) {
8386
$extension = $bundle->getContainerExtension();
8487

8588
if ($extension && $extension->getAlias() === $name) {

0 commit comments

Comments
 (0)
0