Passed
Branch scrutinizer (7e64c3)
by Nikita
06:59 queued 02:33
created

TpgExtjsBundle.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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
    public function build(ContainerBuilder $builder)
14
    {
15
16
        parent::build($builder);
17
18
        $builder->addCompilerPass(new LazyServiceMapPass('tpg_extjs.serialization_visitor', 'format',
19 View Code Duplication
            function(ContainerBuilder $container, Definition $def) {
0 ignored issues
show
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
                if ($container->hasDefinition("tpg_extjs.orm_serializer"))
21
                    $container->getDefinition('tpg_extjs.orm_serializer')->replaceArgument(3, $def);
22
                if ($container->hasDefinition("tpg_extjs.odm_serializer"))
23
                    $container->getDefinition('tpg_extjs.odm_serializer')->replaceArgument(3, $def);
24
            }
25
        ));
26
        $builder->addCompilerPass(new LazyServiceMapPass('tpg_extjs.deserialization_visitor', 'format',
27 View Code Duplication
            function(ContainerBuilder $container, Definition $def) {
0 ignored issues
show
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
                if ($container->hasDefinition("tpg_extjs.orm_serializer"))
29
                    $container->getDefinition('tpg_extjs.orm_serializer')->replaceArgument(4, $def);
30
                if ($container->hasDefinition("tpg_extjs.odm_serializer"))
31
                    $container->getDefinition('tpg_extjs.odm_serializer')->replaceArgument(4, $def);
32
            }
33
        ));
34
35
        $builder->addCompilerPass(new SerializerParserPass());
36
    }
37
}
38