MajoraFrameworkExtraBundle::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 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