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

DifferentCountryWrapper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 17
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A process() 0 7 2
A setLocalName() 0 4 1
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
}