Skip to content

Commit 00894fb

Browse files
[DependencyInjection] fix creating 2nd container instances
1 parent d335c6e commit 00894fb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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) : '';

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)