MajoraFrameworkExtraBundle   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 9

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 1
cbo 9
dl 0
loc 32
ccs 12
cts 12
cp 1
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A build() 0 11 1
1
<?php
2
3
namespace Majora\Bundle\FrameworkExtraBundle;
4
5
use Majora\Bundle\FrameworkExtraBundle\DependencyInjection\Compiler\ActionRegisterCompilerPass;
6
use Majora\Bundle\FrameworkExtraBundle\DependencyInjection\Compiler\AliasRegisterCompilerPass;
7
use Majora\Bundle\FrameworkExtraBundle\DependencyInjection\Compiler\InMemoryDataLoadCompilerPass;
8
use Majora\Bundle\FrameworkExtraBundle\DependencyInjection\Compiler\LoaderBridgeFormCompilerPass;
9
use Majora\Bundle\FrameworkExtraBundle\DependencyInjection\Compiler\LoaderCompilerPass;
10
use Majora\Bundle\FrameworkExtraBundle\DependencyInjection\Compiler\SerializerCompilerPass;
11
use Symfony\Component\DependencyInjection\ContainerBuilder;
12
use Symfony\Component\HttpKernel\Bundle\Bundle;
13
use Symfony\Component\HttpKernel\Config\FileLocator;
14
use Symfony\Component\HttpKernel\KernelInterface;
15
16
class MajoraFrameworkExtraBundle extends Bundle
17
{
18
    /**
19
     * @var FileLocator
20
     */
21
    protected $fileLocator;
22
23
    /**
24
     * Construct.
25
     *
26
     * @param KernelInterface $kernel
27
     */
28 8
    public function __construct(KernelInterface $kernel)
29
    {
30 8
        $this->fileLocator = new FileLocator($kernel);
31 8
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36 2
    public function build(ContainerBuilder $container)
37
    {
38 2
        parent::build($container);
39
40 2
        $container->addCompilerPass(new SerializerCompilerPass());
41 2
        $container->addCompilerPass(new LoaderCompilerPass());
42 2
        $container->addCompilerPass(new InMemoryDataLoadCompilerPass($this->fileLocator));
43 2
        $container->addCompilerPass(new ActionRegisterCompilerPass());
44 2
        $container->addCompilerPass(new AliasRegisterCompilerPass());
45 2
        $container->addCompilerPass(new LoaderBridgeFormCompilerPass());
46 2
    }
47
}
48