Test Failed
Pull Request — master (#2)
by
unknown
04:01 queued 01:47
created

PayseraRestBundle::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 0
cts 13
cp 0
rs 9.6666
c 0
b 0
f 0
cc 1
nc 1
nop 1
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
    public function build(ContainerBuilder $container)
15
    {
16
        parent::build($container);
17
18
        $container->addCompilerPass(new AddTaggedCompilerPass(
19
            'paysera_rest.rest_request_options_registry',
20
            'paysera_rest.request_options',
21
            'registerRestRequestOptions',
22
            ['controller']
23
        ));
24
25
        $container->addCompilerPass(new AddTaggedCompilerPass(
26
            'paysera_rest.path_attribute_resolver_registry',
27
            'paysera_rest.path_attribute_resolver',
28
            'registerPathAttributeResolver',
29
            ['type']
30
        ));
31
    }
32
33
    public function getContainerExtension()
34
    {
35
        if ($this->extension === null) {
36
            $this->extension = $this->createContainerExtension();
37
        }
38
39
        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