Skip to content

Commit 1a4a4ee

Browse files
committed
[DependencyInjection] Fixed a frozen constructor of a container with no parameters
1 parent 2a124bc commit 1a4a4ee

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,13 @@ private function addFrozenConstructor()
689689
*/
690690
public function __construct()
691691
{
692-
\$this->parameters = \$this->getDefaultParameters();
692+
EOF;
693+
694+
if ($this->container->getParameterBag()->all()) {
695+
$code .= "\n \$this->parameters = \$this->getDefaultParameters();\n";
696+
}
697+
698+
$code .= <<<EOF
693699
694700
\$this->services =
695701
\$this->scopedServices =

0 commit comments

Comments
 (0)