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

UrlWrapper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 21
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A process() 0 10 2
A setLocalName() 0 4 1
1
<?php
2
3
namespace devtoolboxuk\cerberus\Wrappers;
4
5
/**
6
 *
7
 * Detect if a URL has been passed through
8
 *
9
 * Class UrlWrapper
10
 * @package devtoolboxuk\cerberus\Wrappers
11
 */
12
class UrlWrapper extends Base
13
{
14
15
    public function process()
16
    {
17
        $this->initWrapper($this->setLocalName());
18
19
        $urlSanitise = $this->soteria->sanitise();
20
        $urlSanitise->removeUrl($this->getReference());
21
22
        if (!$urlSanitise->result()->isValid()) {
23
            $this->setScore($this->getRealScore());
24
            $this->setResult();
25
        }
26
27
    }
28
29
    private function setLocalName()
30
    {
31
        $name = str_replace(__NAMESPACE__ . '\\', '', __CLASS__);
32
        return str_replace('Wrapper', '', $name);
33
    }
34
}