Completed
Push — master ( 1972af...cf5cf8 )
by Rob
02:06
created

DifferentCountryWrapper::process()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 0
dl 0
loc 7
ccs 0
cts 7
cp 0
crap 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace devtoolboxuk\cerberus\Wrappers;
4
5
class DifferentCountryWrapper extends Base
6
{
7
8
    public function process()
9
    {
10
        $this->initWrapper($this->setLocalName());
11
        list($chosenCountry, $detectedCountry) = explode('|', $this->getReference());
12
        if ($chosenCountry != $detectedCountry) {
13
            $this->setScore($this->getRealScore());
14
            $this->setResult();
15
        }
16
    }
17
18
    private function setLocalName()
19
    {
20
        $name = str_replace(__NAMESPACE__ . '\\', '', __CLASS__);
21
        return str_replace('Wrapper', '', $name);
22
    }
23
24
}