| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 16 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 2 | public function run(array $options, ContainerInterface $container, OutputInterface $output = null) |
|
| 24 | { |
||
| 25 | 2 | if (empty($options['consumer_name'])) { |
|
| 26 | 1 | throw new InvalidArgumentException("Options array has to contain consumer_name."); |
|
| 27 | } |
||
| 28 | 1 | if (!$output) { |
|
| 29 | 1 | $output = new NullOutput(); |
|
| 30 | 1 | } |
|
| 31 | 1 | $kernel = $container->get('kernel'); |
|
| 32 | 1 | $application = new Application($kernel); |
|
| 33 | 1 | $application->setAutoExit(false); |
|
| 34 | 1 | $input = new ArrayInput(array( |
|
| 35 | 1 | 'command' => 'rabbitmq:consumer', |
|
| 36 | 1 | '-w' => null, |
|
| 37 | 1 | 'name' => $options['consumer_name'], |
|
| 38 | 1 | )); |
|
| 39 | 1 | $application->run($input, $output); |
|
| 40 | 1 | } |
|
| 41 | |||
| 43 |