Completed
Push — master ( 2d4f4c...04968a )
by Peter
04:27
created

GpsLabGeoIP2Bundle::getContainerExtension()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
dl 0
loc 14
ccs 0
cts 9
cp 0
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 8
nc 3
nop 0
crap 12
1
<?php
2
/**
3
 * GpsLab component.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2017, Peter Gribanov
7
 * @license   http://opensource.org/licenses/MIT
8
 */
9
10
namespace GpsLab\Bundle\GeoIP2Bundle;
11
12
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
13
use Symfony\Component\HttpKernel\Bundle\Bundle;
14
15
class GpsLabGeoIP2Bundle extends Bundle
16
{
17
    /**
18
     * @return ExtensionInterface|bool
19
     */
20
    public function getContainerExtension()
21
    {
22
        if (null === $this->extension) {
23
            $extension = $this->createContainerExtension();
24
25
            if ($extension instanceof ExtensionInterface) {
26
                $this->extension = $extension;
27
            } else {
28
                $this->extension = false;
29
            }
30
        }
31
32
        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 32 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...
33
    }
34
}
35