Completed
Branch v1.x-dev (5736e4)
by Benjamin
04:09
created

RoutesPass   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 6 2
1
<?php
2
3
namespace Obblm\Core\DependencyInjection\CompilerPass;
4
5
use Obblm\Core\Routing\RouteAutoloader;
6
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\DependencyInjection\Reference;
9
10
class RoutesPass implements CompilerPassInterface
11
{
12 1
    public function process(ContainerBuilder $container)
13
    {
14 1
        $definition = $container->findDefinition(RouteAutoloader::class);
15
16 1
        foreach ($container->findTaggedServiceIds('obblm.routes') as $id => $tags) {
17 1
            $definition->addMethodCall('addObblmRoute', [new Reference($id)]);
18
        }
19 1
    }
20
}
21