Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | 2 | public function process(ContainerBuilder $container): void |
|
18 | { |
||
19 | /** @var array<array<mixed>> $pheatureFlagsConfig */ |
||
20 | 2 | $pheatureFlagsConfig = $container->getExtensionConfig('pheature_flags'); |
|
21 | 2 | $mergedConfig = array_merge(...$pheatureFlagsConfig); |
|
22 | |||
23 | 2 | $repository = $container->register(FeatureRepository::class, FeatureRepository::class) |
|
24 | 2 | ->setAutowired(false) |
|
25 | 2 | ->setLazy(true) |
|
26 | 2 | ->setFactory([FeatureRepositoryFactory::class, 'create']) |
|
27 | 2 | ->addArgument(new Reference(ToggleConfig::class)); |
|
28 | |||
29 | 2 | if ('dbal' === $mergedConfig['driver']) { |
|
30 | 1 | $repository->addArgument(new Reference(Connection::class)); |
|
31 | } else { |
||
32 | 1 | $repository->addArgument(null); |
|
33 | } |
||
36 |