On Thu, Feb 3, 2011 at 6:34 PM, Lukas Kahwe Smith <[email protected]>wrote:

>
> Which reminds me, one of my concerns with interface injection is that it
> injects the same service to any class implementing the given interface with
> no way to individually override this. So I have been thinking if it would
> make sense to add something to the DIC to detect if the same setter defined
> by an interface is explicitly listed in the call section of the given
> service and in that case only use the explicit setter call and not the
> implicit one from the interface injection.
>
> This way interface injection would retain its convenience, but would still
> allow customization on a case by case basis.
>

Should be as simple as adding a hasMethodCall() check on the definition
during injector processing [1]. I'm not sure if this violates some principle
of interface injection (would have to defer to Bulat on that :), but it
seems reasonable.  I don't see the point of two method calls that would
likely just clobber each other anyway.

[1]
https://github.com/fabpot/symfony/blob/master/src/Symfony/Component/DependencyInjection/InterfaceInjector.php#L78

-- 
jeremy mikola

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to