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