-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Fix incompatibility with FrameworkBundle <4.3.1 #32792
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
cc9a246
to
7a60820
Compare
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 think an extra addition should include a type check on the argument in the command, as it's never enforced. While I don't think this is a common case, using it without the framework bundle should also give a clear error rather than an invalid method call run-time.
if ($routableBus instanceof ContainerInterface) {
$routableBus = new RoutableMessageBus($routableBus);
} elseif (!$routableBus instanceof RoutableMessageBus) {
throw new ...;
}
symfony/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php
Lines 52 to 60 in d7d6d92
/** | |
* @param RoutableMessageBus $routableBus | |
*/ | |
public function __construct($routableBus, ContainerInterface $receiverLocator, LoggerInterface $logger = null, array $receiverNames = [], /* ContainerInterface */ $retryStrategyLocator = null, EventDispatcherInterface $eventDispatcher = null) | |
{ | |
// to be deprecated in 4.4 | |
if ($routableBus instanceof ContainerInterface) { | |
$routableBus = new RoutableMessageBus($routableBus); | |
} |
7a60820
to
5d73970
Compare
@linaori check added, thanks! |
Thank you @chalasr. |
…1 (chalasr) This PR was merged into the 4.3 branch. Discussion ---------- [Messenger] Fix incompatibility with FrameworkBundle <4.3.1 | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #32738 | License | MIT | Doc PR | - Aims to fix an edge case where you install (or upgrade to) symfony/messenger >=4.3.1 while having symfony/framework-bundle <4.3.1 installed. Commits ------- 5d73970 [Messenger] Fix incompatibility with FrameworkBundle <4.3.1
Aims to fix an edge case where you install (or upgrade to) symfony/messenger >=4.3.1 while having symfony/framework-bundle <4.3.1 installed.