| Conditions | 5 |
| Paths | 4 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 5.0729 |
| Changes | 0 | ||
| 1 | <?php |
||
| 47 | 17 | public function validate($input): bool |
|
| 48 | { |
||
| 49 | 17 | if (is_string($input) && filter_var($input, FILTER_VALIDATE_EMAIL)) { |
|
| 50 | 6 | list(, $domain) = explode('@', $input, 2); |
|
| 51 | 6 | if ($this->checkDns) { |
|
| 52 | return checkdnsrr($domain, 'MX') || checkdnsrr($domain, 'A'); |
||
| 53 | } |
||
| 54 | 6 | return true; |
|
| 55 | } |
||
| 56 | 11 | return false; |
|
| 57 | } |
||
| 58 | } |
||
| 59 |