src/Domain/Value/Identifier/Uri.php
protected static function normalizeHost(?string $host): ?string
    {
        if ($host === null) {
            return null;
        }

        if ($host === '') {
            return '';
        }

        if (!static::isValidHost($host)) {
            $message = sprintf('Invalid host: %s', $host);
            throw new DomainException($message);
        }

        // Although host is case-insensitive, producers and normalizers should
        // use lowercase for registered names and hexadecimal addresses for the
        // sake of uniformity, while only using uppercase letters for
        // percent-encodings.
        $host = mb_strtolower($host, 'UTF-8');

        return static::encodeHost(static::decode($host, static::UNRESERVED_SET));
    }
protected static function normalizeHost(?string $host): ?string
    {
        if ($host === null) {
            return null;
        }

        if ($host === '') {
            return '';
        }

        if (!static::isValidHost($host)) {
            $message = sprintf('Invalid host: %s', $host);
            throw new DomainException($message);
        }

        // Although host is case-insensitive, producers and normalizers should
        // use lowercase for registered names and hexadecimal addresses for the
        // sake of uniformity, while only using uppercase letters for
        // percent-encodings.
        $host = mb_strtolower($host, 'UTF-8');

        return static::encodeHost(static::decode($host, static::UNRESERVED_SET));
    }
protected static function normalizeHost ( ? string $ host ) : ? string { if ( $ host === null ) { return null ; } if ( $ host === '' ) { return '' ; } if ( ! static :: isValidHost ( $ host ) ) { $ message = sprintf ( 'Invalid host: %s' , $ host ) ; throw new DomainException ( $ message ) ; } // Although host is case-insensitive, producers and normalizers should // use lowercase for registered names and hexadecimal addresses for the // sake of uniformity, while only using uppercase letters for // percent-encodings. $ host = mb_strtolower ( $ host , 'UTF-8' ) ; return static :: encodeHost ( static :: decode ( $ host , static :: UNRESERVED_SET ) ) ; }
Validates and normalizes the host

@param string|null $host The host

@return string|null

@throws DomainException When the host is invalid
Validates and normalizes the host