Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | 22 | public function isValid(string $value): bool |
|
17 | { |
||
18 | // This regexp should be kep in sync with the original one in Natural |
||
19 | 22 | if (!preg_match('/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[^@ ]+\.[^@]+$/u', $value)) { |
|
20 | 14 | return false; |
|
21 | } |
||
22 | |||
23 | 8 | $validator = new EmailAddress(); |
|
24 | |||
25 | 8 | return $validator->isValid($value); |
|
26 | } |
||
28 |