| Q |
A |
| Bug report? |
yes |
| Feature request? |
no |
| BC Break report? |
yes |
| RFC? |
no |
| Symfony version |
3.3.0 |
In some commands I use this kind of functionality to disable the sending of Emails:
$this->getContainer()->get('event_dispatcher')->removeSubscriber($this->getContainer()->get('my_email_subscriber'));
And then I put it back:
$this->getContainer()->get('event_dispatcher')->addSubscriber($this->getContainer()->get('my_email_subscriber'));
After some debugging I found out that the EventDispatcher now holds closures to enhance LazyLoading in the $this->listeners array.
So the array_search check does not work anymore in function removeListener.
I'm not sure if this really is a bug or if there is a new way now to achieve this.