PsiContentTypeBundle::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 1
1
<?php
2
3
namespace Psi\Bundle\ContentType;
4
5
use Psi\Bundle\ContentType\DependencyInjection\Compiler\FieldPass;
6
use Psi\Bundle\ContentType\DependencyInjection\Compiler\FormExtensionPass;
7
use Psi\Bundle\ContentType\DependencyInjection\Compiler\StorageTypePass;
8
use Psi\Bundle\ContentType\DependencyInjection\Compiler\ViewPass;
9
use Psi\Bundle\ContentType\DependencyInjection\Storage\PhpcrOdmLoader;
10
use Symfony\Component\DependencyInjection\ContainerBuilder;
11
use Symfony\Component\HttpKernel\Bundle\Bundle;
12
13
class PsiContentTypeBundle extends Bundle
14
{
15
    public function build(ContainerBuilder $container)
16
    {
17
        $extension = $container->getExtension('psi_content_type');
18
        $extension->addStorageLoader('doctrine_phpcr_odm', new PhpcrOdmLoader($container));
19
20
        $container->addCompilerPass(new FieldPass());
21
        $container->addCompilerPass(new ViewPass());
22
        $container->addCompilerPass(new StorageTypePass());
23
        $container->addCompilerPass(new FormExtensionPass());
24
    }
25
}
26