CalendRBundle::build()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
/*
4
 * This file is part of CalendR, a Fréquence web project.
5
 *
6
 * (c) 2012 Fréquence web
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace CalendR\Bridge\Symfony\Bundle;
13
use CalendR\Bridge\Symfony\Bundle\DependencyInjection\Compiler\EventProviderPass;
14
use CalendR\Event\Provider\ProviderInterface;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\HttpKernel\Bundle\Bundle;
17
18
/**
19
 * The Symfony Bundle
20
 *
21
 * @author Yohan Giarelli <[email protected]>
22
 */
23
class CalendRBundle extends Bundle
24
{
25
    public function build(ContainerBuilder $container)
26
    {
27
        if (method_exists($container, 'registerForAutoconfiguration')) {
28
            $container->registerForAutoconfiguration(ProviderInterface::class)->addTag(EventProviderPass::TAG);
29
        }
30
31
        parent::build($container);
32
33
        $container->addCompilerPass(new EventProviderPass);
34
    }
35
}
36