You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php
+4-5
Original file line number
Diff line number
Diff line change
@@ -61,16 +61,15 @@ public function getProxyFactoryCode(Definition $definition, string $id, string $
61
61
62
62
return<<<EOF
63
63
if (true === \$lazyLoad) {
64
-
$instantiation\$container->createProxy('$proxyClass', static function () use (\$containerRef) {
65
-
return \\$proxyClass::staticProxyConstructor(static function (&\$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface \$proxy) use (\$containerRef) {
Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/autowire_closure.php
+1-9
Original file line number
Diff line number
Diff line change
@@ -15,11 +15,9 @@
15
15
class Symfony_DI_PhpDumper_Test_Autowire_Closure extends Container
16
16
{
17
17
protected$parameters = [];
18
-
protectedreadonly\WeakReference$ref;
19
18
20
19
publicfunction__construct()
21
20
{
22
-
$this->ref = \WeakReference::create($this);
23
21
$this->services = $this->privates = [];
24
22
$this->methodMap = [
25
23
'bar' => 'getBarService',
@@ -48,13 +46,7 @@ public function isCompiled(): bool
48
46
*/
49
47
protectedstaticfunctiongetBarService($container)
50
48
{
51
-
$containerRef = $container->ref;
52
-
53
-
return$container->services['bar'] = new \Symfony\Component\DependencyInjection\Tests\Dumper\LazyClosureConsumer(#[\Closure(name: 'foo', class: 'Symfony\\Component\\DependencyInjection\\Tests\\Compiler\\Foo')] function () use ($containerRef) {
54
-
$container = $containerRef->get();
55
-
56
-
return ($container->services['foo'] ??= new \Symfony\Component\DependencyInjection\Tests\Compiler\Foo());
57
-
}, ($container->services['baz'] ?? self::getBazService($container)), ($container->services['foo'] ??= new \Symfony\Component\DependencyInjection\Tests\Compiler\Foo())->cloneFoo(...), ($container->services['my_callable'] ??= new \Symfony\Component\DependencyInjection\Tests\Compiler\MyCallable())->__invoke(...));
49
+
return$container->services['bar'] = new \Symfony\Component\DependencyInjection\Tests\Dumper\LazyClosureConsumer(#[\Closure(name: 'foo', class: 'Symfony\\Component\\DependencyInjection\\Tests\\Compiler\\Foo')] fn () => ($container->services['foo'] ??= new \Symfony\Component\DependencyInjection\Tests\Compiler\Foo()), ($container->services['baz'] ?? self::getBazService($container)), ($container->services['foo'] ??= new \Symfony\Component\DependencyInjection\Tests\Compiler\Foo())->cloneFoo(...), ($container->services['my_callable'] ??= new \Symfony\Component\DependencyInjection\Tests\Compiler\MyCallable())->__invoke(...));
0 commit comments