private function formatHost(?string $host): ?string
    {
        if (null === $host || '' === $host) {
            return $host;
        }

        if ('[' !== $host[0]) {
            return $this->formatRegisteredName($host);
        }

        return $this->formatIp($host);
    }
private function formatHost(?string $host): ?string
    {
        if (null === $host || '' === $host) {
            return $host;
        }

        if ('[' !== $host[0]) {
            return $this->formatRegisteredName($host);
        }

        return $this->formatIp($host);
    }
private function formatHost ( ? string $ host ) : ? string { if ( null === $ host || '' === $ host ) { return $ host ; } if ( '[' !== $ host [ 0 ] ) { return $ this -> formatRegisteredName ( $ host ) ; } return $ this -> formatIp ( $ host ) ; }
Validate and Format the Host component.

@param ?string $host
Validate and Format the Host component .