MediaMonksSonataMediaBundle   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 4 1
A getContainerExtension() 0 8 2
1
<?php
2
3
namespace MediaMonks\SonataMediaBundle;
4
5
use MediaMonks\SonataMediaBundle\DependencyInjection\Compiler\ProviderPass;
6
use MediaMonks\SonataMediaBundle\DependencyInjection\MediaMonksSonataMediaExtension;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\HttpKernel\Bundle\Bundle;
9
10
/**
11
 * @author Robert Slootjes <[email protected]>
12
 */
13
class MediaMonksSonataMediaBundle extends Bundle
14
{
15
    const BUNDLE_CONFIG_NAME = 'mediamonks_sonata_media';
16
17
    /**
18
     * @param ContainerBuilder $container
19
     */
20 1
    public function build(ContainerBuilder $container)
21
    {
22 1
        $container->addCompilerPass(new ProviderPass());
23 1
    }
24
25
    /**
26
     * @inheritdoc
27
     */
28 1
    public function getContainerExtension()
29
    {
30 1
        if (null === $this->extension) {
31 1
            $this->extension = new MediaMonksSonataMediaExtension();
32
        }
33
34 1
        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 34 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...
35
    }
36
}
37