Completed
Push — master ( 5e8af2...ef3cc5 )
by Peter
100:32 queued 44:24
created

GpsLabDomainEventBundle::getContainerExtension()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2
1
<?php
2
/**
3
 * GpsLab component.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2016, Peter Gribanov
7
 * @license   http://opensource.org/licenses/MIT
8
 */
9
10
namespace GpsLab\Bundle\DomainEvent;
11
12
use GpsLab\Bundle\DomainEvent\DependencyInjection\Compiler\EventListenerPass;
13
use GpsLab\Bundle\DomainEvent\DependencyInjection\GpsLabDomainEventExtension;
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
use Symfony\Component\HttpKernel\Bundle\Bundle;
16
17
class GpsLabDomainEventBundle extends Bundle
18
{
19
    /**
20
     * @param ContainerBuilder $container
21
     */
22
    public function build(ContainerBuilder $container)
23
    {
24
        parent::build($container);
25
        $container->addCompilerPass(new EventListenerPass());
26
    }
27
28
    /**
29
     * @return GpsLabDomainEventExtension
30
     */
31 1
    public function getContainerExtension()
32
    {
33 1
        if (!($this->extension instanceof GpsLabDomainEventExtension)) {
34 1
            $this->extension = new GpsLabDomainEventExtension();
35 1
        }
36
37 1
        return $this->extension;
38
    }
39
}
40