src/Generics/Util/EndpointParser.php
public static function parseUrl($url): Endpoint
    {
        $url = UrlParser::parseUrl($url);
        
        return new Endpoint($url->getAddress(), $url->getPort());
    }
public static function parseUrl($url): Endpoint
    {
        $url = UrlParser::parseUrl($url);
        
        return new Endpoint($url->getAddress(), $url->getPort());
    }
Parse a URI into a Endpoint

@param string $url
@throws InvalidUrlException
@return \Generics\Socket\Endpoint