Total Complexity | 5 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | final class LocalSystemDNS implements LocalSystemDNSInterface |
||
13 | { |
||
14 | /** |
||
15 | * @throws \RemotelyLiving\PHPDNS\Resolvers\Exceptions\QueryFailure |
||
16 | */ |
||
17 | public function getRecord(string $hostname, int $type): array |
||
18 | { |
||
19 | $results = @dns_get_record($hostname, $type); |
||
20 | |||
21 | // this is untestable without creating a system networking failure |
||
22 | // @codeCoverageIgnoreStart |
||
23 | if ($results === false) { |
||
24 | throw new QueryFailure(); |
||
25 | } |
||
26 | // @codeCoverageIgnoreEnd |
||
27 | |||
28 | return $results; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @throws \RemotelyLiving\PHPDNS\Resolvers\Exceptions\ReverseLookupFailure |
||
33 | */ |
||
34 | public function getHostnameByAddress(string $IPAddress): string |
||
43 | } |
||
44 | } |
||
45 |