DifferentCountryWrapper   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 21
ccs 0
cts 14
cp 0
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A process() 0 11 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
13
        if ($chosenCountry != $detectedCountry) {
14
            $this->setScore($this->getFailScore());
15
            $this->setResult();
16
        } else {
17
            $this->setScore($this->getScore());
18
            $this->setResult();
19
        }
20
    }
21
22
    private function setLocalName()
23
    {
24
        $name = str_replace(__NAMESPACE__ . '\\', '', __CLASS__);
25
        return str_replace('Wrapper', '', $name);
26
    }
27
28
}