ThrusterSymfonyJsonBodyParserBundle::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 20
rs 9.4285
cc 1
eloc 8
nc 1
nop 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A ThrusterSymfonyJsonBodyParserBundle.php$0 ➔ process() 0 7 1
1
<?php
2
3
namespace Thruster\Bundle\SymfonyJsonBodyParserBundle;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Definition;
8
use Symfony\Component\HttpKernel\Bundle\Bundle;
9
10
/**
11
 * Class ThrusterSymfonyJsonBodyParserBundle
12
 *
13
 * @package Thruster\Bundle\SymfonyJsonBodyParserBundle
14
 * @author  Aurimas Niekis <[email protected]>
15
 * @codeCoverageIgnore
16
 */
17
class ThrusterSymfonyJsonBodyParserBundle extends Bundle
18
{
19
    /**
20
     * @inheritDoc
21
     */
22
    public function build(ContainerBuilder $container)
23
    {
24
        parent::build($container);
25
26
        $container->addCompilerPass(
27
            new class implements CompilerPassInterface
28
            {
29
                /**
30
                 * @inheritDoc
31
                 */
32
                public function process(ContainerBuilder $container)
33
                {
34
                    $definition = new Definition('Thruster\Bundle\SymfonyJsonBodyParserBundle\RequestListener');
35
                    $definition->addTag('kernel.event_subscriber');
36
37
                    $container->setDefinition('thruster_json_body_parser', $definition);
38
                }
39
            }
40
        );
41
    }
42
43
}
44