8000 minor #30659 [Messenger] Add a BC layer for the `ConsumeMessagesComma… · symfony/symfony@468bca8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 468bca8

Browse files
committed
minor #30659 [Messenger] Add a BC layer for the ConsumeMessagesCommand arguments (sroze)
This PR was merged into the 4.3-dev branch. Discussion ---------- [Messenger] Add a BC layer for the `ConsumeMessagesCommand` arguments | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no - removing some | Deprecations? | yes (files already updated in previous PR) | Tests pass? | yes | Fixed tickets | ø | License | MIT | Doc PR | ø Instead of conflicting `symfony/messenger` with an old `symfony/framework-bundle`, let's add a simple BC layer. Commits ------- 2123531 Add a BC layer for the `ConsumeMessagesCommand` arguments
2 parents f206538 + 2123531 commit 468bca8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Symfony/Component/Messenger/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ CHANGELOG
88
and `BusNameStamp` were added, which allow you to add a bus identifier
99
to the `Envelope` then find the correct bus when receiving from
1010
the transport. See `ConsumeMessagesCommand`.
11-
* An optional `ConsumeMessagesCommand` constructor argument was removed.
11+
* The optional `$busNames` constructor argument of the class `ConsumeMessagesCommand` was removed.
1212
* [BC BREAK] 2 new methods were added to `ReceiverInterface`:
1313
`ack()` and `reject()`.
1414
* [BC BREAK] Error handling was moved from the receivers into

src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,14 @@ class ConsumeMessagesCommand extends Command
4343
private $retryStrategyLocator;
4444
private $eventDispatcher;
4545

46-
public function __construct(ContainerInterface $busLocator, ContainerInterface $receiverLocator, LoggerInterface $logger = null, array $receiverNames = [], ContainerInterface $retryStrategyLocator = null, EventDispatcherInterface $eventDispatcher = null)
46+
public function __construct(ContainerInterface $busLocator, ContainerInterface $receiverLocator, LoggerInterface $logger = null, array $receiverNames = [], /* ContainerInterface */ $retryStrategyLocator = null, EventDispatcherInterface $eventDispatcher = null)
4747
{
48+
if (\is_array($retryStrategyLocator)) {
49+
@trigger_error(sprintf('The 5th argument of the class "%s" should be a retry-strategy locator, an array of bus names as a value is deprecated since Symfony 4.3.', __CLASS__), E_USER_DEPRECATED);
50+
51+
$retryStrategyLocator = null;
52+
}
53+
4854
$this->busLocator = $busLocator;
4955
$this->receiverLocator = $receiverLocator;
5056
$this->logger = $logger;

0 commit comments

Comments
 (0)
0