| Conditions | 3 |
| Paths | 1 |
| Total Lines | 26 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | 2 | public function register(Container $container): void |
|
| 31 | { |
||
| 32 | $container->set(Application::class, function (ContainerInterface $container) { |
||
| 33 | 2 | $application = new Application(); |
|
| 34 | |||
| 35 | 2 | $dispatcher = $container->get(SymfonyEventDispatcher::class); |
|
| 36 | 2 | $application->setDispatcher($dispatcher); |
|
| 37 | |||
| 38 | 2 | $loader = new ContainerCommandLoader( |
|
| 39 | 2 | $container, |
|
| 40 | 2 | $this->commands |
|
| 41 | ); |
||
| 42 | |||
| 43 | 2 | $application->setCommandLoader($loader); |
|
| 44 | |||
| 45 | 2 | if ($this->name !== '') { |
|
| 46 | 2 | $application->setName($this->name); |
|
| 47 | } |
||
| 48 | |||
| 49 | 2 | if ($this->version !== '') { |
|
| 50 | 2 | $application->setVersion($this->version); |
|
| 51 | } |
||
| 52 | |||
| 53 | 2 | $application->setAutoExit(false); |
|
| 54 | |||
| 55 | 2 | return $application; |
|
| 56 | 2 | }); |
|
| 59 |