Conditions | 3 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | 2 | public function __invoke(ContainerInterface $container) |
|
14 | { |
||
15 | 2 | $config = $container->has('config') ? $container->get('config') : []; |
|
16 | 2 | $failureTransportName = $config['messenger']['failure_transport'] ?? null; |
|
17 | |||
18 | 2 | if (null === $failureTransportName) { |
|
19 | 1 | throw new InvalidArgumentException('Invalid failure_transport name'); |
|
20 | } |
||
21 | |||
22 | /** @var ContainerInterface $receiverLocator */ |
||
23 | 1 | $receiverLocator = $container->get('messenger.receivers_locator'); |
|
24 | |||
25 | 1 | return new FailedMessagesRemoveCommand( |
|
26 | 1 | $failureTransportName, |
|
27 | 1 | $receiverLocator->get($failureTransportName) |
|
28 | ); |
||
31 |