Closed
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.