Test Failed
Push — master ( cf5cf8...b2d113 )
by Rob
04:15
created

CountryWrapper::setRealScore()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 6
ccs 0
cts 0
cp 0
crap 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace devtoolboxuk\cerberus\Wrappers;
4
5
class CountryWrapper extends Base
6
{
7
8
    public function process()
9
    {
10
        $this->initWrapper($this->setLocalName());
11
        $this->detect();
12
13
        $this->setScore($this->getScore());
14
        $this->setResult();
15
    }
16
17
    private function setLocalName()
18
    {
19
        $name = str_replace(__NAMESPACE__ . '\\', '', __CLASS__);
20
        return str_replace('Wrapper', '', $name);
21
    }
22
23
    private function detect()
24
    {
25
        $params = $this->getParams();
26
27
        if (empty($params)) {
28
            return;
29
        }
30
31
        foreach ($params as $param) {
32
            if ($param != '') {
33
                $data = explode(":", $param);
34
                if (strpos(strtolower($this->sanitizeReference()), strtolower($data[0])) !== false) {
35
                    $this->overRideScore($data);
36
                }
37
            }
38
        }
39
    }
40
41
42
}