Completed
Push — master ( 4fcc05...a85859 )
by Peter
05:13
created

GpsLabPaginationBundle   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B getContainerExtension() 0 17 5
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|null
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 1
        }
34
35 1
        return $this->extension ?: null;
36
    }
37
}
38