Enforced domain to be lowercase for case-sensitivity purposes and corrected some PhpDoc strings

This commit is contained in:
netkas 2025-03-26 15:13:26 -04:00
parent 463e86f59f
commit 2e184ebc74
Signed by: netkas
GPG key ID: 4D8629441B76E4CC

View file

@ -24,6 +24,8 @@
*/ */
public static function resolveDomain(string $domain, bool $useDatabase=true): DnsRecord public static function resolveDomain(string $domain, bool $useDatabase=true): DnsRecord
{ {
$domain = strtolower($domain);
// Return the mocked record if the mocking record is set // Return the mocked record if the mocking record is set
if(isset(self::$mockedRecords[$domain])) if(isset(self::$mockedRecords[$domain]))
{ {
@ -124,11 +126,13 @@
* Adds a mock DNS record for a specific domain. * Adds a mock DNS record for a specific domain.
* *
* @param string $domain The domain name for which the DNS record is being mocked. * @param string $domain The domain name for which the DNS record is being mocked.
* @param DnsRecord $record The DNS record to be associated with the specified domain. * @param DnsRecord|string $record The DNS record to be associated with the specified domain.
* @return void * @return void
*/ */
public static function addMock(string $domain, DnsRecord|string $record): void public static function addMock(string $domain, DnsRecord|string $record): void
{ {
$domain = strtolower($domain);
if(isset(self::$mockedRecords[$domain])) if(isset(self::$mockedRecords[$domain]))
{ {
return; return;