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:
commit
2787024e34
@ -270,7 +270,7 @@ class EventDispatcher implements EventDispatcherInterface
|
|||||||
$this->sorted[$eventName] = [];
|
$this->sorted[$eventName] = [];
|
||||||
|
|
||||||
foreach ($this->listeners[$eventName] as &$listeners) {
|
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) {
|
if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure) {
|
||||||
$listener[0] = $listener[0]();
|
$listener[0] = $listener[0]();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user