From 31975e49811c08cefafa9ef8af5c948f39ed9249 Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Fri, 6 Dec 2019 19:56:25 +0100 Subject: [PATCH] [FrameworkBundle][ContainerLintCommand] Reinitialize bundles when the container is reprepared --- .../Bundle/FrameworkBundle/Command/ContainerLintCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerLintCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerLintCommand.php index dd942b36a9739..10b3cf1b0dd81 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerLintCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerLintCommand.php @@ -69,7 +69,11 @@ private function getContainerBuilder(): ContainerBuilder $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'));