-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
DXDX = Developer eXperience (anything that improves the experience of using Symfony)DX = Developer eXperience (anything that improves the experience of using Symfony)DependencyInjectionRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)
Description
The current implementation of autowiring seems to force unnecessary coupling and to be instable in case of change in a vendor's service implementation.
Example 1:
interface IA
interface IB extends IA
*service* class C implemets IB
I can autowire using the type hint IB
, but not IA
.
Example 2:
interface I
class CA implements I
*service* class CB extends CA
I cannot type hint on I
.
This means, autowiring would break if an intermediary interface or an abstract class were added. Nothing in the documentation (http://symfony.com/doc/current/components/dependency_injection/autowiring.html) mentions this limitation and it seems highly counter-intuitive.
If you agree this should be addressed, I am ready to provide a PR to fix this.
Metadata
Metadata
Assignees
Labels
DXDX = Developer eXperience (anything that improves the experience of using Symfony)DX = Developer eXperience (anything that improves the experience of using Symfony)DependencyInjectionRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)