-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] gracefully handle missing event dispatchers #34854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
xabbuh
commented
Dec 6, 2019
Q | A |
---|---|
Branch? | 4.3 |
Bug fix? | yes |
New feature? | no |
Deprecations? | no |
Tickets | Fix #34852 |
License | MIT |
Doc PR |
@@ -39,7 +39,11 @@ class SendMessageMiddleware implements MiddlewareInterface | |||
public function __construct(SendersLocatorInterface $sendersLocator, EventDispatcherInterface $eventDispatcher = null) | |||
{ | |||
$this->sendersLocator = $sendersLocator; | |||
$this->eventDispatcher = LegacyEventDispatcherProxy::decorate($eventDispatcher); | |||
|
|||
if (null !== $eventDispatcher) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe also add a class_exists check?
in master, could replace the contracts by PSR-14 if that makes sense btw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some other places where we could make use of that too.
Thank you @xabbuh. |
…abbuh) This PR was merged into the 4.3 branch. Discussion ---------- [Messenger] gracefully handle missing event dispatchers | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #34852 | License | MIT | Doc PR | Commits ------- d4ae85f gracefully handle missing event dispatchers