MultipleConsumerCommand::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 7
ccs 5
cts 5
cp 1
crap 1
rs 10
1
<?php
2
3
namespace OldSound\RabbitMqBundle\Command;
4
5
use Symfony\Component\Console\Input\InputArgument;
6
7
class MultipleConsumerCommand extends BaseConsumerCommand
8
{
9 1
    protected function configure()
10
    {
11 1
        parent::configure();
12
13 1
        $this->setDescription('Executes a consumer that uses multiple queues')
14 1
                ->setName('rabbitmq:multiple-consumer')
15 1
                ->addArgument('context', InputArgument::OPTIONAL, 'Context the consumer runs in')
16
        ;
17 1
    }
18
19
    protected function getConsumerService()
20
    {
21
        return 'old_sound_rabbit_mq.%s_multiple';
22
    }
23
24
    protected function initConsumer($input)
25
    {
26
        parent::initConsumer($input);
27
        $this->consumer->setContext($input->getArgument('context'));
28
    }
29
}