This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony
Fabien Potencier 4033b602ff feature #20260 [DependencyInjection] Support autowiring for EventDispatcher/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 @weaverryan

IMHO 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
2016-12-06 15:46:10 +01:00
..
Bridge Merge branch '3.2' 2016-11-26 20:22:04 -08:00
Bundle feature #20260 [DependencyInjection] Support autowiring for EventDispatcher/EventDispatcherInterface (chalasr) 2016-12-06 15:46:10 +01:00
Component feature #20777 [ClassLoader] Deprecate Apc/WinCache/Xcache class loaders (nicolas-grekas) 2016-12-06 14:31:11 +01:00