ZenstruckRedirectBundle::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Zenstruck\RedirectBundle;
4
5
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\HttpKernel\Bundle\Bundle;
8
9
/**
10
 * @author Kevin Bond <[email protected]>
11
 */
12
class ZenstruckRedirectBundle extends Bundle
13
{
14 2
    public function build(ContainerBuilder $container)
15
    {
16 2
        parent::build($container);
17
18 2
        $this->addRegisterMappingsPass($container);
19 2
    }
20
21 2
    private function addRegisterMappingsPass(ContainerBuilder $container)
22
    {
23
        $mappings = [
24 2
            \realpath(__DIR__.'/Resources/config/doctrine-mapping') => 'Zenstruck\RedirectBundle\Model',
25
        ];
26
27 2
        $container->addCompilerPass(DoctrineOrmMappingsPass::createXmlMappingDriver($mappings));
28 2
    }
29
}
30