Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
41 | 2 | public function handle() |
|
42 | { |
||
43 | 2 | $messageCount = $this->input->getOption('messages'); |
|
44 | 2 | $waitTime = $this->input->getOption('time'); |
|
45 | 2 | $memoryLimit = $this->input->getOption('memory'); |
|
46 | |||
47 | /** @var ConsumerInterface $consumer */ |
||
48 | 2 | $consumer = $this->getConsumer($this->input->getArgument('consumer')); |
|
49 | try { |
||
50 | 2 | return $consumer->startConsuming($messageCount, $waitTime, $memoryLimit); |
|
51 | 1 | } catch (\Throwable $e) { |
|
52 | 1 | $consumer->stopConsuming(); |
|
53 | 1 | $this->output->error($e->getMessage()); |
|
54 | 1 | return -1; |
|
55 | } |
||
56 | } |
||
57 | } |
||
58 |