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 |
||
15 | 6 | public function process(ContainerBuilder $container) |
|
16 | { |
||
17 | 6 | if (!$container->hasDefinition('prometheus_metrics_bundle.adapter')) { |
|
18 | return; |
||
19 | } |
||
20 | |||
21 | $adapterClasses = [ |
||
22 | 6 | 'in_memory' => InMemory::class, |
|
23 | 'apcu' => APC::class, |
||
24 | 'redis' => Redis::class, |
||
25 | ]; |
||
26 | |||
27 | 6 | $definition = $container->getDefinition('prometheus_metrics_bundle.adapter'); |
|
28 | 6 | $definition->setAbstract(false); |
|
29 | 6 | $definition->setClass($adapterClasses[$container->getParameter('prometheus_metrics_bundle.type')]); |
|
30 | 6 | if ('redis' === $container->getParameter('prometheus_metrics_bundle.type')) { |
|
31 | 3 | $definition->setArguments([$container->getParameter('prometheus_metrics_bundle.redis')]); |
|
32 | } |
||
35 |