Skip to content

Commit 1be0c97

Browse files
committed
Merge branch '5.1'
* 5.1: [HttpClient] fix chaining promises returned by HttplugClient [DI] fix dumping lazy non-shared services
2 parents 8da74cd + 52e8a8a commit 1be0c97

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Dumper/PhpDumper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,7 @@ protected function {$methodName}($lazyInitialization)
886886
if ($asFile) {
887887
$code = str_replace('$this', '$container', $code);
888888
$code = str_replace('function () {', 'function () use ($container) {', $code);
889+
$code = str_replace('function ($lazyLoad = true) {', 'function ($lazyLoad = true) use ($container) {', $code);
889890
}
890891

891892
$code .= " }\n";

Tests/Fixtures/php/services_non_shared_lazy_as_files.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class getNonSharedFooService extends ProjectServiceContainer
3030
{
3131
include_once $container->targetDir.''.'/Fixtures/includes/foo_lazy.php';
3232

33-
$container->factories['non_shared_foo'] = function ($lazyLoad = true) {
33+
$container->factories['non_shared_foo'] = function ($lazyLoad = true) use ($container) {
3434
return new \Bar\FooLazyClass();
3535
};
3636

0 commit comments

Comments
 (0)