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

InvalidEmail::code()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
}