Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3.0123 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | 6 | public function process(ContainerBuilder $container) |
|
19 | { |
||
20 | 6 | if (!$container->hasDefinition('prometheus_metrics_bundle.adapter')) { |
|
21 | return; |
||
22 | } |
||
23 | |||
24 | $adapterClasses = [ |
||
25 | 6 | 'in_memory' => InMemory::class, |
|
26 | 'apcu' => APC::class, |
||
27 | 'redis' => Redis::class, |
||
28 | ]; |
||
29 | |||
30 | 6 | $definition = $container->getDefinition('prometheus_metrics_bundle.adapter'); |
|
31 | 6 | $definition->setAbstract(false); |
|
32 | 6 | $definition->setClass($adapterClasses[$container->getParameter('prometheus_metrics_bundle.type')]); |
|
33 | 6 | if ('redis' === $container->getParameter('prometheus_metrics_bundle.type')) { |
|
34 | 3 | $definition->setArguments([$container->getParameter('prometheus_metrics_bundle.redis')]); |
|
35 | } |
||
38 |