validateNameserver($nameserver); } $this->nameservers = $nameservers; $this->artax = $artax ?? new DefaultClient(); $this->cache = $cache ?? new ArrayCache(5000/* default gc interval */, 256/* size */); $this->configLoader = $configLoader ?? (\stripos(PHP_OS, "win") === 0 ? new WindowsConfigLoader : new UnixConfigLoader); $this->simpleResolver = $resolver ?? new Rfc1035StubResolver(null, $this->configLoader); } private function validateNameserver($nameserver) { if (!($nameserver instanceof Nameserver)) { throw new ConfigException("Invalid nameserver: {$nameserver}"); } } public function getNameservers(): array { return $this->nameservers; } public function isNameserver($string): bool { foreach ($this->nameservers as $nameserver) { if ($nameserver->getHost() === $string) { return true; } } return false; } public function getArtax(): Client { return $this->artax; } public function getCache(): Cache { return $this->cache; } public function getConfigLoader(): ConfigLoader { return $this->configLoader; } public function getSimpleResolver(): Resolver { return $this->simpleResolver; } }