code: private function getHostAndPort(string $domain): array
      {
          if (false !== strpos($domain, ':')) {
              return explode(':', $domain, 2);
          }
  
          return [$domain, null];
      }
docs: Extracts host and port from the domain.
  
  @return (string|null)[]