LinkGeneratorsPass::process()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2.0116

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 6
cts 7
cp 0.8571
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2.0116
1
<?php
2
3
namespace JMS\JobQueueBundle\DependencyInjection\CompilerPass;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Reference;
8
9
class LinkGeneratorsPass implements CompilerPassInterface
10
{
11 6
    public function process(ContainerBuilder $container)
12
    {
13 6
        $generators = array();
14 6
        foreach ($container->findTaggedServiceIds('jms_job_queue.link_generator') as $id => $attrs) {
15
            $generators[] = new Reference($id);
16
        }
17
18 6
        $container->getDefinition('jms_job_queue.twig.extension')
19 6
                ->addArgument($generators);
20
    }
21
}