SonataAnnotationBundle::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace KunicMarko\SonataAnnotationBundle;
6
7
use KunicMarko\SonataAnnotationBundle\DependencyInjection\Compiler\AccessCompilerPass;
8
use KunicMarko\SonataAnnotationBundle\DependencyInjection\Compiler\AddChildCompilerPass;
9
use KunicMarko\SonataAnnotationBundle\DependencyInjection\Compiler\AutoRegisterCompilerPass;
10
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
11
use Symfony\Component\DependencyInjection\ContainerBuilder;
12
use Symfony\Component\HttpKernel\Bundle\Bundle;
13
14
/**
15
 * @author Marko Kunic <[email protected]>
16
 */
17
final class SonataAnnotationBundle extends Bundle
18
{
19
    public function build(ContainerBuilder $container): void
20
    {
21
        $container->addCompilerPass(new AutoRegisterCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 1);
22
        $container->addCompilerPass(new AccessCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -1);
23
        $container->addCompilerPass(new AddChildCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -1);
24
    }
25
}
26