Test Failed
Pull Request — master (#1)
by
unknown
02:09
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
    public function build(ContainerBuilder $container)
13
    {
14
        parent::build($container);
15
16
        $container->addCompilerPass(new AddTaggedCompilerPass(
17
            'paysera_rest.rest_request_options_registry',
18
            'paysera_rest.request_options',
19
            'registerRestRequestOptions',
20
            ['controller']
21
        ));
22
23
        $container->addCompilerPass(new AddTaggedCompilerPass(
24
            'paysera_rest.path_attribute_resolver_registry',
25
            'paysera_rest.path_attribute_resolver',
26
            'registerPathAttributeResolver',
27
            ['type']
28
        ));
29
    }
30
31
    public function getContainerExtension()
32
    {
33
        if ($this->extension === null) {
34
            $this->extension = $this->createContainerExtension();
35
        }
36
37
        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 37 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...
38
    }
39
}
40