ApplePassbookBundle::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
3
declare(strict_types=1);
4
5
namespace LauLamanApps\ApplePassbookBundle;
6
7
use LauLamanApps\ApplePassbookBundle\DependencyInjection\ApplePassbookExtension;
8
use Symfony\Component\HttpKernel\Bundle\Bundle;
9
10
final class ApplePassbookBundle extends Bundle
11
{
12 2
    public function getContainerExtension()
13
    {
14 2
        if (null === $this->extension) {
15 2
            $this->extension = new ApplePassbookExtension();
16
        }
17
18 2
        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 18 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...
19
    }
20
}
21