Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DependencyInjection] Support autowiring for EventDispatcher/EventDispatcherInterface#20260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
89de71d to5a47ec7Comparechalasr commentedOct 21, 2016
The Status: needs work |
ogizanagi commentedOct 21, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
The If we want to make this PR work properly with the event dispatcher in debug mode, we should transfer the |
29dbb87 tocd003a0Comparechalasr commentedOct 21, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@ogizanagi As you suggested, I made The However we still need to manually cleanup the Anyway, that's really not a big deal (one method call on the definition). |
da8fb14 tod7ca505Comparechalasr commentedOct 21, 2016
Failing build on travis unrelated (yaml) |
ogizanagi commentedOct 21, 2016
It's kind of a big deal. 😄 I thought71d502a was supposed to handle this case 😕 |
chalasr commentedOct 21, 2016
Needs#20267 for removingthis method call. |
2c0636b to3acbff9Compare| <argumenttype="service"id="debug.stopwatch" /> | ||
| <argumenttype="service"id="logger"on-invalid="null" /> | ||
| <autowiring-type>Symfony\Component\EventDispatcher\EventDispatcherInterface</autowiring-type> | ||
| <autowiring-type>Symfony\Component\EventDispatcher\EventDispatcher</autowiring-type> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This will not be needed with#20267 too
…the autowiring types (chalasr)This PR was merged into the 2.8 branch.Discussion----------[DependencyInjection] A decorated service should not keep the autowiring types| Q | A| ------------- | ---| Branch? | 2.8| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#20260 (comment)| License | MIT| Doc PR | n/aWhen decorating a service which is not abstract and has `autowiring_types`, the decorator should be the one used for autowiring methods of autowired services, so we should explicitly empty them on the decorated definition after merged them into the child. See#20260 (comment) for a use case where we are forced to manually empty the decorated service's `autowiring_types`.Commits-------5951378 A decorated service should not keep the autowiring types
…the autowiring types (chalasr)This PR was merged into the 2.8 branch.Discussion----------[DependencyInjection] A decorated service should not keep the autowiring types| Q | A| ------------- | ---| Branch? | 2.8| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |symfony/symfony#20260 (comment)| License | MIT| Doc PR | n/aWhen decorating a service which is not abstract and has `autowiring_types`, the decorator should be the one used for autowiring methods of autowired services, so we should explicitly empty them on the decorated definition after merged them into the child. Seesymfony/symfony#20260 (comment) for a use case where we are forced to manually empty the decorated service's `autowiring_types`.Commits-------5951378 A decorated service should not keep the autowiring types
chalasr commentedOct 24, 2016
Needs branch 2.8 to be merged in master |
3acbff9 to3c6c488Comparechalasr commentedOct 25, 2016
I made the changes after#20267, this is ready. |
3c6c488 tod2d68ddCompare7ce69e0 toe25dd2fComparechalasr commentedNov 5, 2016
Tests have been fixed. |
xabbuh commentedNov 5, 2016
👍 Status: Reviewed |
javiereguiluz commentedNov 7, 2016
@dunglas could you please review/approve this proposal? Do you think it's ready for 3.2? Thanks! |
dunglas commentedNov 7, 2016
👍 For me it's ok to merge this PR in 3.2. |
e25dd2f to5fd4733Comparechalasr commentedNov 17, 2016
apparently it will finally be for 3.3 as many others, it would be nice to have an explanation. |
dunglas commentedNov 17, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
fabpot commentedNov 17, 2016
End of development happened more than a month and a half ago. Since then, we should not have merged new features or significant changes. We did some for features that were discussion since a very long time, but we had priorities. RC1 is just around the corner, so merging anything substantial at this point is not possible anymore. Sorry about that, but we need to make choices. That's our release process. Date is fixed, features are not. |
chalasr commentedNov 17, 2016
And I can perfectly understand, thank you for the hint. |
chalasr commentedDec 6, 2016
I believe this can be merged now that 3.2 is released. |
fabpot commentedDec 6, 2016
Thank you@chalasr. |
…atcher/EventDispatcherInterface (chalasr)This PR was merged into the 3.3-dev branch.Discussion----------[DependencyInjection] Support autowiring for EventDispatcher/EventDispatcherInterface| Q | A || --- | --- || Branch? | master || Bug fix? | no || New feature? | yes || BC breaks? | no || Deprecations? | no || Tests pass? | yes || Fixed tickets | n/a || License | MIT || Doc PR | n/a |As it is a very common dependency. Currently it gives:> [Symfony\Component\DependencyInjection\Exception\RuntimeException]> Unable to autowire argument of type "Symfony\Component\EventDispatcher\EventDispatcherInterface" for the service "dummy". Multiple services exist for this interface (debug.event_dispatcher, debug.event_dispatcher.parent).After this, the `TraceableEventDispatcher` will be injected in dev and the `ContainerAwareEventDispatcher` in prod, as when injecting `@event_dispatcher` explicitly.ping@weaverryanIMHO this could be treated as a an enhancement for the autowiring feature and be part of 3.2.Commits-------5fd4733 Support autowiring for EventDispatcher/EventDispatcherInterface
…entDispatcher/EventDispatcherInterface (chalasr)This PR was merged into the 3.3-dev branch.Discussion----------[DependencyInjection] Support autowiring for EventDispatcher/EventDispatcherInterface| Q | A || --- | --- || Branch? | master || Bug fix? | no || New feature? | yes || BC breaks? | no || Deprecations? | no || Tests pass? | yes || Fixed tickets | n/a || License | MIT || Doc PR | n/a |As it is a very common dependency. Currently it gives:> [Symfony\Component\DependencyInjection\Exception\RuntimeException]> Unable to autowire argument of type "Symfony\Component\EventDispatcher\EventDispatcherInterface" for the service "dummy". Multiple services exist for this interface (debug.event_dispatcher, debug.event_dispatcher.parent).After this, the `TraceableEventDispatcher` will be injected in dev and the `ContainerAwareEventDispatcher` in prod, as when injecting `@event_dispatcher` explicitly.ping@weaverryanIMHO this could be treated as a an enhancement for the autowiring feature and be part of 3.2.Commits-------5fd4733 Support autowiring for EventDispatcher/EventDispatcherInterface
…entDispatcher/EventDispatcherInterface (chalasr)This PR was merged into the 3.3-dev branch.Discussion----------[DependencyInjection] Support autowiring for EventDispatcher/EventDispatcherInterface| Q | A || --- | --- || Branch? | master || Bug fix? | no || New feature? | yes || BC breaks? | no || Deprecations? | no || Tests pass? | yes || Fixed tickets | n/a || License | MIT || Doc PR | n/a |As it is a very common dependency. Currently it gives:> [Symfony\Component\DependencyInjection\Exception\RuntimeException]> Unable to autowire argument of type "Symfony\Component\EventDispatcher\EventDispatcherInterface" for the service "dummy". Multiple services exist for this interface (debug.event_dispatcher, debug.event_dispatcher.parent).After this, the `TraceableEventDispatcher` will be injected in dev and the `ContainerAwareEventDispatcher` in prod, as when injecting `@event_dispatcher` explicitly.ping@weaverryanIMHO this could be treated as a an enhancement for the autowiring feature and be part of 3.2.Commits-------5fd4733 Support autowiring for EventDispatcher/EventDispatcherInterface
Uh oh!
There was an error while loading.Please reload this page.
As it is a very common dependency. Currently it gives:
After this, the
TraceableEventDispatcherwill be injected in dev and theContainerAwareEventDispatcherin prod, as when injecting@event_dispatcherexplicitly.ping@weaverryan
IMHO this could be treated as a an enhancement for the autowiring feature and be part of 3.2.