Skip to content
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

[Messenger] gracefully handle missing event dispatchers #34854

Merged
merged 1 commit into from Dec 7, 2019

Conversation

xabbuh
Copy link
Member

@xabbuh 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) {
Copy link
Member

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

Copy link
Member Author

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.

@fabpot
Copy link
Member

fabpot commented Dec 7, 2019

Thank you @xabbuh.

fabpot added a commit that referenced this pull request Dec 7, 2019
…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
@fabpot fabpot merged commit d4ae85f into symfony:4.3 Dec 7, 2019
@xabbuh xabbuh deleted the issue-34852 branch December 7, 2019 07:35
This was referenced Dec 19, 2019
@fabpot fabpot mentioned this pull request Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants