Skip to content

Commit e7e8b05

Browse files
committed
[FrameworkBundle] Set the parameter bag as resolved in ContainerLintCommand
1 parent 69ac426 commit e7e8b05

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Command/ContainerLintCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
2121
use Symfony\Component\DependencyInjection\ContainerBuilder;
2222
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
23+
use Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag;
2324

2425
final class ContainerLintCommand extends Command
2526
{
@@ -71,7 +72,11 @@ private function getContainerBuilder(): ContainerBuilder
7172
$buildContainer = \Closure::bind(function () { return $this->buildContainer(); }, $kernel, \get_class($kernel));
7273
$container = $buildContainer();
7374
} else {
74-
(new XmlFileLoader($container = new ContainerBuilder(), new FileLocator()))->load($kernel->getContainer()->getParameter('debug.container.dump'));
75+
(new XmlFileLoader($container = new ContainerBuilder($parameterBag = new EnvPlaceholderParameterBag()), new FileLocator()))->load($kernel->getContainer()->getParameter('debug.container.dump'));
76+
77+
$refl = new \ReflectionProperty($parameterBag, 'resolved');
78+
$refl->setAccessible(true);
79+
$refl->setValue($parameterBag, true);
7580
}
7681

7782
return $this->containerBuilder = $container;

0 commit comments

Comments
 (0)