RegisterClientDecodersPass   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 3
dl 0
loc 18
ccs 9
cts 9
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 12 2
1
<?php
2
3
namespace Innmind\RestBundle\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
7
use Symfony\Component\DependencyInjection\Reference;
8
9
class RegisterClientDecodersPass implements CompilerPassInterface
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14 2
    public function process(ContainerBuilder $container)
15
    {
16 2
        $delegation = $container->getDefinition('innmind_rest.client.decoder.delegation');
17 2
        $ids = $container->findTaggedServiceIds('innmind_rest.client.decoder');
18 2
        $decoders = [];
19
20 2
        foreach ($ids as $id => $tags) {
21 2
            $decoders[] = new Reference($id);
22 2
        }
23
24 2
        $delegation->replaceArgument(0, $decoders);
25 2
    }
26
}
27