Completed
Push — master ( 3d6a71...4fcc05 )
by Peter
05:12
created

GpsLabPaginationBundle   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 24
ccs 12
cts 12
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getContainerExtension() 0 18 4
1
<?php
2
/**
3
 * GpsLab component.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2011, Peter Gribanov
7
 * @license   http://opensource.org/licenses/MIT
8
 */
9
10
namespace GpsLab\Bundle\PaginationBundle;
11
12
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
13
use Symfony\Component\HttpKernel\Bundle\Bundle;
14
15
class GpsLabPaginationBundle extends Bundle
16
{
17
    /**
18
     * @return ExtensionInterface|bool
19
     */
20 1
    public function getContainerExtension()
21
    {
22 1
        if (null === $this->extension) {
23 1
            $this->extension = false;
24 1
            $class = $this->getContainerExtensionClass();
25
26 1
            if (class_exists($class)) {
27 1
                $extension = new $class();
28
29 1
                if ($extension instanceof ExtensionInterface) {
30 1
                    $this->extension = $extension;
31 1
                }
32 1
            }
33
34 1
        }
35
36 1
        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 36 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...
37
    }
38
}
39