XabbuhXApiClientBundle   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 5

Test Coverage

Coverage 0%
Metric Value
wmc 3
cbo 5
dl 0
loc 23
ccs 0
cts 12
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 5 1
A getContainerExtension() 0 8 2
1
<?php
2
3
/*
4
 * This file is part of the xAPI package.
5
 *
6
 * (c) Christian Flothmann <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Xabbuh\XApi\Bundle\ClientBundle;
13
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
use Symfony\Component\HttpKernel\Bundle\Bundle;
16
use Xabbuh\XApi\Bundle\ClientBundle\DependencyInjection\Compiler\RegisterClientsPass;
17
use Xabbuh\XApi\Bundle\ClientBundle\DependencyInjection\Compiler\RegisterSerializerMetadataPass;
18
use Xabbuh\XApi\Bundle\ClientBundle\DependencyInjection\XabbuhXApiClientExtension;
19
20
/**
21
 * Experience API client bundle.
22
 *
23
 * @author Christian Flothmann <[email protected]>
24
 */
25
class XabbuhXApiClientBundle extends Bundle
26
{
27
    /**
28
     * {@inheritDoc}
29
     */
30
    public function build(ContainerBuilder $container)
31
    {
32
        $container->addCompilerPass(new RegisterClientsPass());
33
        $container->addCompilerPass(new RegisterSerializerMetadataPass());
34
    }
35
36
    /**
37
     * {@inheritDoc}
38
     */
39
    public function getContainerExtension()
40
    {
41
        if (null === $this->extension) {
42
            $this->extension = new XabbuhXApiClientExtension();
43
        }
44
45
        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 45 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...
46
    }
47
}
48