8000 Add a BC layer for the `ConsumeMessagesCommand` arguments · symfony/symfony@b46c230 · GitHub
[go: up one dir, main page]

Skip to content

Commit b46c230

Browse files
committed
Add a BC layer for the ConsumeMessagesCommand arguments
1 parent f206538 commit b46c230

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