Skip to content

Commit feb75f3

Browse files
bug #44063 [DependencyInjection] fix creating 2nd container instances (nicolas-grekas)
This PR was merged into the 5.4 branch. Discussion ---------- [DependencyInjection] fix creating 2nd container instances | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #44062 | License | MIT | Doc PR | - Commits ------- 2658fed [DependencyInjection] fix creating 2nd container instances
2 parents 720e489 + 2658fed commit feb75f3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,7 @@ private function addInlineRequires(bool $hasProxyClasses): string
14851485
}
14861486

14871487
if ($hasProxyClasses) {
1488-
$code .= "\n include __DIR__.'/proxy-classes.php';";
1488+
$code .= "\n include_once __DIR__.'/proxy-classes.php';";
14891489
}
14901490

14911491
return $code ? sprintf("\n \$this->privates['service_container'] = function () {%s\n };\n", $code) : '';

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_lazy_inlined_factories.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class ProjectServiceContainer extends Container
6060
$this->aliases = [];
6161

6262
$this->privates['service_container'] = function () {
63-
include __DIR__.'/proxy-classes.php';
63+
include_once __DIR__.'/proxy-classes.php';
6464
};
6565
}
6666

0 commit comments

Comments
 (0)