Same here, this is going too far. The complexity of the DIC has already increased tenfold in the last few months, and it was already confusing the hell out of some devs, so we have to stop somewhere or we'll lose most people I think.
Cheers On Sat, Jan 29, 2011 at 2:21 PM, Fabien Potencier <[email protected]> wrote: > -1 for me. The current way looks simple and powerful enough. > > Fabien > > On 1/29/11 1:38 PM, Johannes wrote: >> >> Right now, the order in which you specify the arguments in the service >> definition is meaningful, and they will be mapped to the constructor >> in the same order. Let's say, you have >> >> <service id="foo"> >> <argument>a</argument> >> <argument>b</argument> >> </service> >> >> Then the constructor will look similar to this "new Foo('a', 'b');". >> >> For definitions which inherit from other definitions, it is also >> possible to specify the index of an argument like this >> >> <service parent="foo" id="bar"> >> <argument index="0">c</argument> >> </service> >> >> The constructor would then receive "new Foo('c', 'b');". >> >> I'd like to make the argument element a bit more consistent, powerful >> and intelligent. Let's say you have the following class: >> >> class Foo >> { >> public function __construct($a, $b, Bar $c) { } >> } >> >> 1. Argument mapping based on parameter name >> <argument name="a">a</argument> >> >> 2. Argument mapping based on parameter index (0-based) >> <argument index="1">b</argument> >> >> 3. Argument mapping based on type inference (this argument would be >> mapped to $c if the service "bar" is an instance of Bar) >> <argument type="service" id="bar" /> >> >> >> Since this would mean a major BC break (many<argument> tags which >> cannot be determined based on type inference would need to be >> updated), I'd like to hear your opinion. >> > > -- > 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 > -- Jordi Boggiano @seldaek :: http://seld.be/ -- 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
