bug #40246 [EventDispatcher] fix registering subscribers twice on edge-case (nicolas-grekas)

This PR was merged into the 5.2 branch.

Discussion
----------

[EventDispatcher] fix registering subscribers twice on edge-case

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Introduced on 5.1 in #36243

Commits
-------

ad60072998 [EventDispatcher] fix registering subscribers twice on edge-case
This commit is contained in:
Nicolas Grekas 2021-02-18 21:49:41 +01:00
commit 2f4cd77e04

View File

@ -149,7 +149,7 @@ class RegisterListenersPass implements CompilerPassInterface
continue;
}
$dispatcherDefinitions[] = $container->getDefinition($attributes['dispatcher']);
$dispatcherDefinitions[$attributes['dispatcher']] = $container->getDefinition($attributes['dispatcher']);
}
if (!$dispatcherDefinitions) {