| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function __invoke(ContainerInterface $container): ContredanseDb |
||
| 13 | { |
||
| 14 | $config = $container->get('config')['contredanse'] ?? null; |
||
| 15 | if ($config === null) { |
||
| 16 | throw new ConfigException("['contredanse'] config key is missing."); |
||
| 17 | } |
||
| 18 | if (!is_array($config['db'] ?? false)) { |
||
| 19 | throw new ConfigException("['contredanse']['db'] config key is missing."); |
||
| 20 | } |
||
| 21 | |||
| 22 | return new ContredanseDb( |
||
| 23 | $config['db'] |
||
| 24 | ); |
||
| 27 |