8000 Fixing a bug where autoconfigure was "lost" if the service had an ins… · symfony/symfony@13b9dc8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 13b9dc8

Browse files
committed
Fixing a bug where autoconfigure was "lost" if the service had an instanceof
1 parent bc2283a commit 13b9dc8

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ private function doResolveDefinition(ChildDefinition $definition)
170170
// these attributes are always taken from the child
171171
$def->setAbstract($definition->isAbstract());
172172
$def->setTags($definition->getTags());
173+
// autoconfigure is never taken from parent (on purpose)
174+
// and it's not legal on an instanceof
175+
$def->setAutoconfigured($definition->isAutoconfigured());
173176

174177
return $def;
175178
}

src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/integration/defaults_instanceof_importance/expected.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ services:
44
class: Symfony\Component\DependencyInjection\Tests\Compiler\IntegrationTestStub
55
# _instanceof overrides _defaults
66
autowire: false
7+
# inherited from _defaults
78
autoconfigure: true
89
# from _instanceof
910
shared: false

0 commit comments

Comments
 (0)
0