Total Complexity | 5 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
9 | class NoRFCWarningsValidation extends RFCValidation |
||
10 | { |
||
11 | /** |
||
12 | * @var InvalidEmail|null |
||
13 | */ |
||
14 | private $error; |
||
15 | |||
16 | /** |
||
17 | * {@inheritdoc} |
||
18 | */ |
||
19 | 4 | public function isValid(string $email, EmailLexer $emailLexer) : bool |
|
20 | { |
||
21 | 4 | if (!parent::isValid($email, $emailLexer)) { |
|
22 | 1 | return false; |
|
23 | } |
||
24 | |||
25 | 3 | if (empty($this->getWarnings())) { |
|
26 | 2 | return true; |
|
27 | } |
||
28 | |||
29 | 1 | $this->error = new InvalidEmail(new RFCWarnings(), ''); |
|
30 | |||
31 | 1 | return false; |
|
32 | } |
||
33 | |||
34 | /** |
||
35 | * {@inheritdoc} |
||
36 | */ |
||
37 | 4 | public function getError() : ?InvalidEmail |
|
40 | } |
||
41 | } |
||
42 |