| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | 3 | public function execute($command, callable $next) |
|
| 32 | { |
||
| 33 | 3 | if ($command instanceof ReceivedCommand) { |
|
| 34 | 1 | $command = $command->getCommand(); |
|
| 35 | |||
| 36 | 1 | return $next($command); |
|
| 37 | } |
||
| 38 | |||
| 39 | 2 | if (!empty($queues = $this->queueProducerStrategy->produceQueues($command))) { |
|
| 40 | 1 | foreach ($queues as $queue) { |
|
| 41 | 1 | $this->publisherFactory->publish($queue); |
|
| 42 | } |
||
| 43 | |||
| 44 | 1 | return null; |
|
| 45 | } |
||
| 46 | |||
| 47 | 1 | return $next($command); |
|
| 48 | } |
||
| 49 | } |
||
| 50 |