JMSTranslationBundlePass::process()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
ccs 8
cts 8
cp 1
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Goetas\TwitalBundle\DependencyInjection\Compiler;
4
5
use Goetas\TwitalBundle\Translation\Jms\TwitalExtractor;
6
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\DependencyInjection\Reference;
9
10
/**
11
 *
12
 * @author Asmir Mustafic <[email protected]>
13
 *
14
 */
15
class JMSTranslationBundlePass implements CompilerPassInterface
16 7
{
17
    public function process(ContainerBuilder $container)
18 7
    {
19 1
        if ($container->hasDefinition('jms_translation.extractor.file.twig_extractor')) {
20 1
            $container->register('twital.translation.extractor.jms', TwitalExtractor::class)
21 1
                ->setDecoratedService('jms_translation.extractor.file.twig_extractor', 'jms_translation.extractor.file.twig_extractor.inner')
22 1
                ->setArguments(array(
23 1
                    new Reference('twig'),
24 1
                    new Reference('twital.loader'),
25
                    new Reference('jms_translation.extractor.file.twig_extractor.inner'),
26
                ));
27 7
        }
28
    }
29
}
30
31