Test Failed
Push — master ( 70851a...066afa )
by Rob
03:38
created

InvalidEmailWrapper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
c 0
b 0
f 0
dl 0
loc 24
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A process() 0 15 2
A setLocalName() 0 4 1
1
<?php
2
3
namespace devtoolboxuk\cerberus\Wrappers;
4
5
/**
6
 *
7
 * Detect that an email address is valid
8
 *
9
 * Class EmailWrapper
10
 * @package devtoolboxuk\cerberus\Wrappers
11
 */
12
class InvalidEmailWrapper extends Base
13
{
14
15
    public function process()
16
    {
17
        $this->initWrapper($this->setLocalName());
18
19
        $sanitise = $this->soteria->sanitise();
20
21
        $sanitise->disinfect($this->getReference(), 'email');
22
23
        $this->setOutput($sanitise->result()->getOutput());
24
25
        if (!$sanitise->result()->isValid()) {
26
            $this->setScore($this->getRealScore());
27
        }
28
29
        $this->setResult();
30
    }
31
32
    private function setLocalName()
33
    {
34
        $name = str_replace(__NAMESPACE__ . '\\', '', __CLASS__);
35
        return str_replace('Wrapper', '', $name);
36
    }
37
38
}