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

GpsLabDomainEventBundle   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 55.56%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 23
ccs 5
cts 9
cp 0.5556
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 5 1
A getContainerExtension() 0 8 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