MultipleConsumerCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 54.55%

Importance

Changes 3
Bugs 1 Features 0
Metric Value
eloc 8
c 3
b 1
f 0
dl 0
loc 21
ccs 6
cts 11
cp 0.5455
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getConsumerService() 0 3 1
A configure() 0 7 1
A initConsumer() 0 4 1
1
<?php
2
3
namespace OldSound\RabbitMqBundle\Command;
4
5
use Symfony\Component\Console\Input\InputArgument;
6
use Symfony\Component\Console\Input\InputInterface;
7
8
class MultipleConsumerCommand extends BaseConsumerCommand
9
{
10 1
    protected function configure(): void
11
    {
12 1
        parent::configure();
13
14 1
        $this->setDescription('Executes a consumer that uses multiple queues')
15 1
                ->setName('rabbitmq:multiple-consumer')
16 1
                ->addArgument('context', InputArgument::OPTIONAL, 'Context the consumer runs in')
17
        ;
18 1
    }
19
20
    protected function getConsumerService()
21
    {
22
        return 'old_sound_rabbit_mq.%s_multiple';
23
    }
24
25
    protected function initConsumer(InputInterface $input)
26
    {
27
        parent::initConsumer($input);
28
        $this->consumer->setContext($input->getArgument('context'));
29
    }
30
}
31