SerializerParserPass::process()   B
last analyzed

Complexity

Conditions 5
Paths 2

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 11.4436

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 0
loc 15
ccs 4
cts 11
cp 0.3636
rs 8.8571
cc 5
eloc 9
nc 2
nop 1
crap 11.4436
1
<?php
2
namespace Tpg\ExtjsBundle\DependencyInjection;
3
4
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
use Symfony\Component\DependencyInjection\Reference;
7
8
class SerializerParserPass implements CompilerPassInterface {
9
10
    /**
11
     * You can modify the container here before it is dumped to PHP code.
12
     *
13
     * @param ContainerBuilder $container
14
     *
15
     * @api
16
     */
17 1
    public function process(ContainerBuilder $container)
18
    {
19
        if (
20 1
            $container->hasDefinition("nelmio_api_doc.parser.jms_metadata_parser") &&
21
            (
22
                $container->getAlias("fos_rest.serializer") == "tpg_extjs.orm_serializer" ||
23
                $container->getAlias("fos_rest.serializer") == "tpg_extjs.odm_serializer" ||
24
                $container->getAlias("fos_rest.serializer") == "tpg_extjs.serializer"
25
            )
26 1
        ) {
27
            $container
28
                ->getDefinition("nelmio_api_doc.parser.jms_metadata_parser")
29
                ->replaceArgument(1, new Reference("tpg_extjs.naming_strategy"));
30
        }
31
    }
32
}