8000 set synthetic flag from $definition, not $parentDef · symfony/symfony@9da5da3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9da5da3

Browse files
committed
set synthetic flag from $definition, not $parentDef
1 parent 75bb8f8 commit 9da5da3

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/Symfony/Component/DependencyInjection/Compiler/ResolveChildDefinitionsPass.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,11 @@ private function doResolveDefinition(ChildDefinition $definition): Definition
111111
$def->setLazy($parentDef->isLazy());
112112
$def->setAutowired($parentDef->isAutowired());
113113
$def->setChanges($parentDef->getChanges());
114-
$def->setSynthetic($parentDef->isSynthetic());
115114

116115
$def->setBindings($definition->getBindings() + $parentDef->getBindings());
117116

117+
$def->setSynthetic($definition->isSynthetic());
118+
118119
// overwrite with values specified in the decorator
119120
$changes = $definition->getChanges();
120121
if (isset($changes['class'])) {

src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveChildDefinitionsPassTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,13 +417,11 @@ public function testProcessCopiesSyntheticStatus()
417417
{
418418
$container = new ContainerBuilder();
419419

420-
$container
421-
->register('parent')
422-
->setSynthetic(true)
423-
;
420+
$container->register('parent');
424421

425422
$container
426423
->setDefinition('child', new ChildDefinition('parent'))
424+
->setSynthetic(true)
427425
;
428426

429427
$this->process($container);

0 commit comments

Comments
 (0)
0