Test Setup Failed
Push — 3.0.0-dev ( ebd405...ab6a4f )
by Eduardo Gulias
02:25
created

InvalidEmail   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 27
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A isValid() 0 4 1
A description() 0 4 1
A code() 0 4 1
1
<?php
2
3
namespace Egulias\EmailValidator\Result;
4
5
use Egulias\EmailValidator\Result\Reason\Reason;
6
7
class InvalidEmail implements Result
8
{
9
    private  $token;
10
    private $reason;
11
12
    public function __construct(Reason $reason, string $token)
13
    {
14
        $this->token = $token;
15
        $this->reason = $reason;
16
    }
17
18
    public function isValid(): bool
19
    {
20
        return false;
21
    }
22
23
    public function description(): string
24
    {
25
        return $this->reason->description() . " in char " . $this->token;
26
    }
27
28
    public function code(): int
29
    {
30
        return $this->reason->code();
31
    }
32
33
}