bug #35278 [EventDispatcher] expand listener in place (xabbuh)

This PR was merged into the 4.3 branch.

Discussion
----------

[EventDispatcher] expand listener in place

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #35259
| License       | MIT
| Doc PR        |

Commits
-------

f5d407318d expand listener in place
This commit is contained in:
Nicolas Grekas 2020-01-09 15:01:40 +01:00
commit 2787024e34

View File

@ -270,7 +270,7 @@ class EventDispatcher implements EventDispatcherInterface
$this->sorted[$eventName] = [];
foreach ($this->listeners[$eventName] as &$listeners) {
foreach ($listeners as $k => $listener) {
foreach ($listeners as $k => &$listener) {
if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure) {
$listener[0] = $listener[0]();
}