Completed
Push — master ( 9b8114...2ed294 )
by Nils
02:31
created

LeankoalaExtension   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 28
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 7 2
A getSystem() 0 8 2
A nullFunction() 0 3 1
1
<?php
2
3
namespace whm\Smoke\Extensions\Leankoala;
4
5
use whm\Smoke\Config\Configuration;
6
7
class LeankoalaExtension
8
{
9
    private $systems = array();
10
11
    public function init(Configuration $_configuration)
12
    {
13
        if ($_configuration->hasSection('Leankoala')) {
14
            $config = $_configuration->getSection('Leankoala');
15
            $this->systems = $config['systems'];
16
        }
17
    }
18
19
    public function getSystem($componentId)
20
    {
21
        if (array_key_exists($componentId, $this->systems)) {
22
            return (string) $this->systems[$componentId];
23
        } else {
24
            return $componentId;
25
        }
26
    }
27
28
    /**
29
     * @Event("Scanner.CheckResponse.isFiltered")
30
     */
31
    public function nullFunction()
32
    {
33
    }
34
}
35