[FrameworkBundle][ContainerLintCommand] Reinitialize bundles when the container is reprepared
This commit is contained in:
parent
70dec3c8a3
commit
31975e4981
@ -69,7 +69,11 @@ final class ContainerLintCommand extends Command
|
||||
$kernel = $this->getApplication()->getKernel();
|
||||
|
||||
if (!$kernel->isDebug() || !(new ConfigCache($kernel->getContainer()->getParameter('debug.container.dump'), true))->isFresh()) {
|
||||
$buildContainer = \Closure::bind(function () { return $this->buildContainer(); }, $kernel, \get_class($kernel));
|
||||
$buildContainer = \Closure::bind(function (): ContainerBuilder {
|
||||
$this->initializeBundles();
|
||||
|
||||
return $this->buildContainer();
|
||||
}, $kernel, \get_class($kernel));
|
||||
$container = $buildContainer();
|
||||
} else {
|
||||
(new XmlFileLoader($container = new ContainerBuilder($parameterBag = new EnvPlaceholderParameterBag()), new FileLocator()))->load($kernel->getContainer()->getParameter('debug.container.dump'));
|
||||
|
Reference in New Issue
Block a user