Passed
Branch master (a0cc06)
by Dāvis
17:06
created

Extension::setExt()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Sludio\HelperBundle\DependencyInjection;
4
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
7
class Extension
8
{
9
    protected $ext;
10
11
    public function __construct($type)
12
    {
13
        $className = 'Sludio\\HelperBundle\\DependencyInjection\\Component\\'.ucfirst($type);
14
        $this->setExt(class_exists($className) ? new $className() : null);
15
    }
16
17
    public function configure(ContainerBuilder &$container)
18
    {
19
        return $this->getExtension()->configure($container);
20
    }
21
22
    public function getExtension()
23
    {
24
        return $this->ext;
25
    }
26
27
    function setExt($ext)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
28
    {
29
        $this->ext = $ext;
30
    }
31
}