Conditions | 4 |
Paths | 6 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4.25 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | 2 | public static function checkMx(string $hostname): bool |
|
11 | { |
||
12 | 2 | $hostname .= '.'; |
|
13 | try { |
||
14 | 2 | if (!@dns_check_record($hostname, 'MX')) { |
|
15 | 2 | return false; |
|
16 | } |
||
17 | 2 | $result = @dns_get_record($hostname, DNS_MX); |
|
18 | 2 | return $result !== false && count($result) > 0; |
|
19 | } catch (\Throwable $t) { |
||
|
|||
20 | } |
||
21 | return false; |
||
22 | } |
||
44 | } |