| Conditions | 4 |
| Paths | 5 |
| Total Lines | 22 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4.5923 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types = 1); |
||
| 22 | 1 | public function __construct(ContainerInterface $container) |
|
| 23 | { |
||
| 24 | 1 | if (!$container->has(ContainerKeys::CONSOLE_COMMANDS)) { |
|
| 25 | $this->symfonyApplication = new Application(); |
||
| 26 | return; |
||
| 27 | } |
||
| 28 | |||
| 29 | 1 | $application = new Application(); |
|
| 30 | |||
| 31 | 1 | if ($container->has(ContainerKeys::CONSOLE_HELPER_SET)) { |
|
| 32 | $helperSet = $container->get(ContainerKeys::CONSOLE_HELPER_SET); |
||
| 33 | $application->setHelperSet($helperSet); |
||
| 34 | } |
||
| 35 | |||
| 36 | 1 | $commands = $container->get(ContainerKeys::CONSOLE_COMMANDS); |
|
| 37 | |||
| 38 | /** @var Command $command */ |
||
| 39 | 1 | foreach ($commands as $command) { |
|
| 40 | 1 | $application->add($command); |
|
| 41 | } |
||
| 42 | |||
| 43 | 1 | $this->symfonyApplication = $application; |
|
| 44 | 1 | } |
|
| 56 |