Skip to content

[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

Merged
merged 1 commit into from
Aug 5, 2019

Conversation

chalasr
Copy link
Member

@chalasr chalasr commented Jul 28, 2019

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.

Copy link
Contributor

@linaori linaori left a 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 ...;
}

/**
* @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);
}

@chalasr
Copy link
Member Author

chalasr commented Aug 2, 2019

@linaori check added, thanks!

@fabpot
Copy link
Member

fabpot commented Aug 5, 2019

Thank you @chalasr.

@fabpot fabpot merged commit 5d73970 into symfony:4.3 Aug 5, 2019
fabpot added a commit that referenced this pull request Aug 5, 2019
…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
@chalasr chalasr deleted the fix-consume-cmd-def branch August 5, 2019 06:09
@fabpot fabpot mentioned this pull request Aug 26, 2019
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.

4 participants