PayseraRestBundle::getContainerExtension()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Maba\Bundle\RestBundle;
5
6
use Paysera\Component\DependencyInjection\AddTaggedCompilerPass;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\HttpKernel\Bundle\Bundle;
9
10
class PayseraRestBundle extends Bundle
11
{
12
    protected $name = 'MabaPayseraRestBundle';
13
14 81
    public function build(ContainerBuilder $container)
15
    {
16 81
        parent::build($container);
17
18 81
        $container->addCompilerPass(new AddTaggedCompilerPass(
19 81
            'paysera_rest.rest_request_options_registry',
20 81
            'paysera_rest.request_options',
21 81
            'registerRestRequestOptions',
22 81
            ['controller']
23
        ));
24
25 81
        $container->addCompilerPass(new AddTaggedCompilerPass(
26 81
            'paysera_rest.path_attribute_resolver_registry',
27 81
            'paysera_rest.path_attribute_resolver',
28 81
            'registerPathAttributeResolver',
29 81
            ['type']
30
        ));
31 81
    }
32
33 81
    public function getContainerExtension()
34
    {
35 81
        if ($this->extension === null) {
36 81
            $this->extension = $this->createContainerExtension();
37
        }
38
39 81
        return $this->extension;
0 ignored issues
show
Comprehensibility Best Practice introduced by
The expression $this->extension; of type object|null|false adds false to the return on line 39 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...
40
    }
41
}
42