KaliopeZObjectWrapperBundle   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 5 1
A getContainerExtension() 0 7 2
1
<?php
2
3
namespace Kaliop\eZObjectWrapperBundle;
4
5
use Symfony\Component\HttpKernel\Bundle\Bundle;
6
use Kaliop\eZObjectWrapperBundle\DependencyInjection\KaliopeZObjectWrapperExtension;
7
use Kaliop\eZObjectWrapperBundle\DependencyInjection\TaggedServicesCompilerPass;
8
use Symfony\Component\DependencyInjection\ContainerBuilder;
9
10
class KaliopeZObjectWrapperBundle extends Bundle
11
{
12
    public function build(ContainerBuilder $container)
13
    {
14
        parent::build($container);
15
        $container->addCompilerPass(new TaggedServicesCompilerPass());
16
    }
17
18
    /**
19
     * This is only needed to avoid Sf complaining that our extension has a custom alias
20
     */
21
    public function getContainerExtension()
22
    {
23
        if (null === $this->extension) {
24
            $this->extension = new KaliopeZObjectWrapperExtension();
25
        }
26
        return $this->extension;
0 ignored issues
show
Comprehensibility Best Practice introduced by
The expression $this->extension; of type Symfony\Component\Depend...xtensionInterface|false adds false to the return on line 26 which is incompatible with the return type declared by the interface Symfony\Component\HttpKe...::getContainerExtension of type Symfony\Component\Depend...ExtensionInterface|null. It seems like you forgot to handle an error condition.
Loading history...
27
    }
28
}
29