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

GpsLabGeoIP2Bundle   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getContainerExtension() 0 14 3
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