src/Hostname.php
private static function myValidateDomainParts(array $domainParts, ?string &$error): bool
    {
        foreach ($domainParts as $part) {
            if (!is_string($part)) {
                throw new \InvalidArgumentException('$domainParts parameter is not an array of strings.');
            }

            if (!self::myValidateDomainPart($part, $error)) {
                return false;
            }
        }

        return true;
    }
private static function myValidateDomainParts(array $domainParts, ?string &$error): bool
    {
        foreach ($domainParts as $part) {
            if (!is_string($part)) {
                throw new \InvalidArgumentException('$domainParts parameter is not an array of strings.');
            }

            if (!self::myValidateDomainPart($part, $error)) {
                return false;
            }
        }

        return true;
    }
private static function myValidateDomainParts ( array $ domainParts , ? string & $ error ) : bool { foreach ( $ domainParts as $ part ) { if ( ! is_string ( $ part ) ) { throw new \ InvalidArgumentException ( '$domainParts parameter is not an array of strings.' ) ; } if ( ! self :: myValidateDomainPart ( $ part , $ error ) ) { return false ; } } return true ; }
Validates domain parts.

@param string[]    $domainParts The domain parts.
@param string|null $error       The error text if validation was not successful, undefined otherwise.

@throws \InvalidArgumentException If the $domainParts parameter is not an array of strings.

@return bool True if validation was successful, false otherwise.
Validates domain parts .