![]() Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : fdshops ( 1003) PHP Version : 8.2.21 Disable Function : NONE Directory : /home/fdshops/public_html/vendor/egulias/email-validator/src/Validation/ |
<?php namespace Egulias\EmailValidator\Validation; class DNSGetRecordWrapper { /** * @param string $host * @param int $type * * @return DNSRecords */ public function getRecords(string $host, int $type): DNSRecords { // A workaround to fix https://bugs.php.net/bug.php?id=73149 /** @psalm-suppress InvalidArgument */ set_error_handler( static function (int $errorLevel, string $errorMessage): never { throw new \RuntimeException("Unable to get DNS record for the host: $errorMessage"); } ); try { // Get all MX, A and AAAA DNS records for host return new DNSRecords(dns_get_record($host, $type)); } catch (\RuntimeException $exception) { return new DNSRecords([], true); } finally { restore_error_handler(); } } }