TpgExtjsBundle::build()   B
last analyzed

Complexity

Conditions 5
Paths 1

Size

Total Lines 24
Code Lines 15

Duplication

Lines 12
Ratio 50 %

Code Coverage

Tests 19
CRAP Score 5

Importance

Changes 4
Bugs 2 Features 2
Metric Value
c 4
b 2
f 2
dl 12
loc 24
ccs 19
cts 19
cp 1
rs 8.5125
cc 5
eloc 15
nc 1
nop 1
crap 5
1
<?php
2
3
namespace Tpg\ExtjsBundle;
4
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
use Symfony\Component\HttpKernel\Bundle\Bundle;
7
use JMS\DiExtraBundle\DependencyInjection\Compiler\LazyServiceMapPass;
8
use Symfony\Component\DependencyInjection\Definition;
9
use Tpg\ExtjsBundle\DependencyInjection\SerializerParserPass;
10
11
class TpgExtjsBundle extends Bundle
12
{
13 1
    public function build(ContainerBuilder $builder)
14
    {
15
16 1
        parent::build($builder);
17
18 1
        $builder->addCompilerPass(new LazyServiceMapPass('tpg_extjs.serialization_visitor', 'format',
19 View Code Duplication
            function(ContainerBuilder $container, Definition $def) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
20 1
                if ($container->hasDefinition("tpg_extjs.orm_serializer"))
21 1
                    $container->getDefinition('tpg_extjs.orm_serializer')->replaceArgument(3, $def);
22 1
                if ($container->hasDefinition("tpg_extjs.odm_serializer"))
23 1
                    $container->getDefinition('tpg_extjs.odm_serializer')->replaceArgument(3, $def);
24 1
            }
25 1
        ));
26 1
        $builder->addCompilerPass(new LazyServiceMapPass('tpg_extjs.deserialization_visitor', 'format',
27 1 View Code Duplication
            function(ContainerBuilder $container, Definition $def) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
28 1
                if ($container->hasDefinition("tpg_extjs.orm_serializer"))
29 1
                    $container->getDefinition('tpg_extjs.orm_serializer')->replaceArgument(4, $def);
30 1
                if ($container->hasDefinition("tpg_extjs.odm_serializer"))
31 1
                    $container->getDefinition('tpg_extjs.odm_serializer')->replaceArgument(4, $def);
32 1
            }
33 1
        ));
34
35 1
        $builder->addCompilerPass(new SerializerParserPass());
36 1
    }
37
}
38