8000 bug #34784 [FrameworkBundle] Set the parameter bag as resolved in Con… · symfony/symfony@c01a583 · GitHub
[go: up one dir, main page]

Skip to content

Commit c01a583

Browse files
author
Robin Chalas
committed
bug #34784 [FrameworkBundle] Set the parameter bag as resolved in ContainerLintCommand (fancyweb)
This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle] Set the parameter bag as resolved in ContainerLintCommand | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #34526, Closes #34767 | License | MIT | Doc PR | - Alternative to #34767, idea by @nicolas-grekas. Commits ------- e8d3c2b [FrameworkBundle] Set the parameter bag as resolved in ContainerLintCommand
2 parents 1f00705 + e8d3c2b commit c01a583

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/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)
0