KaliopeZObjectWrapperBundle::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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