8000 bug #18137 Autowiring the concrete class too - consistent with behavi… · symfony/symfony@9999dcb · GitHub
[go: up one dir, main page]

Skip to content

Commit 9999dcb

Browse files
committed
bug #18137 Autowiring the concrete class too - consistent with behavior of other services (weaverryan)
This PR was merged into the 2.8 branch. Discussion ---------- Autowiring the concrete class too - consistent with behavior of other services | Q | A | ------------- | --- | Branch | 2.8 | Bug fix? | yes | New feature? | no | 8000 BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #18132 | License | MIT | Doc PR | n/a This follows #17261. Without this, if you use the concrete class `Container`, it doesn't autowire, so it creates a *new* one. That is certainly not what the end-user wants, and it's a serious WTF :). We can talk all day long about not injecting the container and type-hinting interfaces, but this is needed to be consistent with how all the other services in the container work and to avoid this odd behavior. Thanks! Commits ------- 2ea3f68 Autowiring the concrete class too - consistent with behavior of other services
2 parents e8b102e + 2ea3f68 commit 9999dcb

File tree

1 file changed

+1
-0
lines changed
  • src/Symfony/Bundle/FrameworkBundle/Resources/config

1 file changed

+1
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
<service id="service_container" synthetic="true">
5050
<autowiring-type>Symfony\Component\DependencyInjection\ContainerInterface</autowiring-type>
51+
<autowiring-type>Symfony\Component\DependencyInjection\Container</autowiring-type>
5152
</service>
5253

5354
<service id="kernel" synthetic="true" />

0 commit comments

Comments
 (0)
0