ConfigGroupCompilerPass   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 12
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 10 3
1
<?php
2
3
namespace Xiidea\EasyConfigBundle\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Reference;
8
9
class ConfigGroupCompilerPass implements CompilerPassInterface
10
{
11
    public function process(ContainerBuilder $container): void
12
    {
13
        if (false === $container->hasDefinition('xiidea.easy_config.service_manager')) {
14
            return;
15
        }
16
17
        $definition = $container->getDefinition('xiidea.easy_config.service_manager');
18
19
        foreach ($container->findTaggedServiceIds('xiidea.easy_config.group') as $id => $attributes) {
20
            $definition->addMethodCall('addConfigGroup', [new Reference($id)]);
21
        }
22
    }
23
}
24