Completed
Push — master ( 210262...6f2223 )
by Peter
17s queued 11s
created

GpsLabDomainEventBundle::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
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 1
    public function build(ContainerBuilder $container)
23
    {
24 1
        $container->addCompilerPass(new EventListenerPass());
25 1
    }
26
27
    /**
28
     * @return GpsLabDomainEventExtension
29
     */
30 1
    public function getContainerExtension()
31
    {
32 1
        if (!($this->extension instanceof GpsLabDomainEventExtension)) {
33 1
            $this->extension = new GpsLabDomainEventExtension();
34
        }
35
36 1
        return $this->extension;
37
    }
38
}
39