8000 [DependencyInjection] Fix resolving parameters when dumping lazy proxies · symfony/symfony@123d453 · GitHub
[go: up one dir, main page]

Skip to content

Commit 123d453

Browse files
[DependencyInjection] Fix resolving parameters when dumping lazy proxies
1 parent 1efcf0e commit 123d453

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,11 +2265,6 @@ private function isProxyCandidate(Definition $definition, ?bool &$asGhostObject,
22652265
return null;
22662266
}
22672267

2268-
$bag = $this->container->getParameterBag();
2269-
$definition = (clone $definition)
2270-
->setClass($bag->resolveValue($definition->getClass()))
2271-
->setTags(($definition->hasTag('proxy') ? ['proxy' => $bag->resolveValue($definition->getTag('proxy'))] : []) + $definition->getTags());
2272-
22732268
return $this->getProxyDumper()->isProxyCandidate($definition, $asGhostObject, $id) ? $definition : null;
22742269
}
22752270
}

src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public function getProxyFactoryCode(Definition $definition, string $id, string $
3535

3636
/**
3737
* Generates the code for the lazy proxy.
38+
*
39+
* @param string|null $id
3840
*/
3941
public function getProxyCode(Definition $definition/* , string $id = null */): string;
4042
}

src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,8 @@ public function testDumpAsFilesWithLazyFactoriesInlined()
281281
$container = new ContainerBuilder();
282282
$container->setParameter('container.dumper.inline_factories', true);
283283
$container->setParameter('container.dumper.inline_class_loader', true);
284-
$container->setParameter('lazy_foo_class', \Bar\FooClass::class);
285284

286-
$container->register('lazy_foo', '%lazy_foo_class%')
285+
$container->register('lazy_foo', \Bar\FooClass::class)
287286
->addArgument(new Definition(\Bar\FooLazyClass::class))
288287
->setPublic(true)
289288
->setLazy(true);

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class ProjectServiceContainer extends Container
7373
/**
7474
* Gets the public 'lazy_foo' shared service.
7575
*
76-
* @return object A %lazy_foo_class% instance
76+
* @return \Bar\FooClass
7777
*/
7878
protected function getLazyFooService($lazyLoad = true)
7979
{
@@ -145,7 +145,6 @@ class ProjectServiceContainer extends Container
145145
return [
146146
'container.dumper.inline_factories' => true,
147147
'container.dumper.inline_class_loader' => true,
148-
'lazy_foo_class' => 'Bar\\FooClass',
149148
];
150149
}
151150
}

0 commit comments

Comments
 (0)
0