final class HostnamePolicy (View source)

The three dns.* settings that decide how strictly a hostname's labels and TLD are checked.

Methods

__construct(bool $topLevelTldCheck = false, bool $strictTldCheck = false, array $customTlds = [])

No description

static HostnamePolicy
fromConfig(ConfigurationInterface $config)

No description

bool
allowsCustomTld(string $tld)

Whether the TLD is on the custom list (case-insensitive).

Details

__construct(bool $topLevelTldCheck = false, bool $strictTldCheck = false, array $customTlds = [])

No description

Parameters

bool $topLevelTldCheck

Reject single-label names

bool $strictTldCheck

Require a known TLD (IANA list or custom list)

array $customTlds

Extra TLDs accepted under strict checking

static HostnamePolicy fromConfig(ConfigurationInterface $config)

No description

Parameters

ConfigurationInterface $config

Return Value

HostnamePolicy

bool allowsCustomTld(string $tld)

Whether the TLD is on the custom list (case-insensitive).

Parameters

string $tld

Return Value

bool