PayseraRestBundle   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 32
ccs 17
cts 17
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 18 1
A getContainerExtension() 0 8 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