Conditions | 3 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
37 | 5 | protected function initialize(InputInterface $input, OutputInterface $output) |
|
38 | { |
||
39 | 5 | parent::initialize($input, $output); |
|
40 | 5 | $this->io = new SymfonyStyle($input, $output); |
|
41 | |||
42 | 5 | $connectionName = 'mongo.connection'; |
|
43 | |||
44 | 5 | if ($input->getOption('connection')) { |
|
45 | 2 | $connectionName .= '.'.$input->getOption('connection'); |
|
46 | } |
||
47 | |||
48 | 5 | if (!$this->getContainer()->has($connectionName)) { |
|
49 | 1 | throw new \LogicException(sprintf('No connection named \'%s\' found', $input->getOption('connection'))); |
|
50 | } |
||
51 | |||
52 | 4 | $this->connection = $this->getContainer()->get($connectionName); |
|
53 | 4 | } |
|
54 | } |
||
55 |