MultipleConsumerCommand::getConsumerService()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
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