Skip to content

Commit

Permalink
minor #42483 [EventDispatcher] fix getSubscribedEvents() event yieldi…
Browse files Browse the repository at this point in the history
…ng instead or returning array (nicolas-grekas)

This PR was merged into the 5.4 branch.

Discussion
----------

[EventDispatcher] fix getSubscribedEvents() event yielding instead or returning array

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

`EventSubscriberInterface::getSubscribedEvents()` is described as returning an `array`. Yielding here is breaking the contracts.

Commits
-------

f18231a [EventDispatcher] fix getSubscribedEvents() event yielding instead or returning array
  • Loading branch information
nicolas-grekas committed Aug 11, 2021
2 parents 1d19615 + f18231a commit eb1971b
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -42,8 +42,10 @@ public function onWorkerMessageFailed()

public static function getSubscribedEvents()
{
yield WorkerMessageHandledEvent::class => 'onWorkerMessageHandled';
yield WorkerMessageFailedEvent::class => 'onWorkerMessageFailed';
return [
WorkerMessageHandledEvent::class => 'onWorkerMessageHandled',
WorkerMessageFailedEvent::class => 'onWorkerMessageFailed',
];
}

private function clearEntityManagers()
Expand Down

0 comments on commit eb1971b

Please sign in to comment.