private function getHostAndPort($domain) { if (false !== strpos($domain, ':')) { return explode(':', $domain, 2); } return [$domain, null]; }