public function validateSocketUri($uri)
    {
        $uri = (string)$uri;
        if (!$uri) {
            throw new InvalidArgumentException('Invalid URI');
        }

        $scheme = parse_url($uri, PHP_URL_SCHEME);
        $scheme = $this->validateScheme($scheme);

        $host = parse_url($uri, PHP_URL_HOST);
        if (!$host) {
            throw new InvalidArgumentException("Invalid host");
        }

        $port = parse_url($uri, PHP_URL_PORT);
        if (!$port) {
            $port = $this->getPort($scheme);
        }

        return [$scheme, $host, $port];
    }
public function validateSocketUri($uri)
    {
        $uri = (string)$uri;
        if (!$uri) {
            throw new InvalidArgumentException('Invalid URI');
        }

        $scheme = parse_url($uri, PHP_URL_SCHEME);
        $scheme = $this->validateScheme($scheme);

        $host = parse_url($uri, PHP_URL_HOST);
        if (!$host) {
            throw new InvalidArgumentException("Invalid host");
        }

        $port = parse_url($uri, PHP_URL_PORT);
        if (!$port) {
            $port = $this->getPort($scheme);
        }

        return [$scheme, $host, $port];
    }
public function validateSocketUri ( $ uri ) { $ uri = ( string ) $ uri ; if ( ! $ uri ) { throw new InvalidArgumentException ( 'Invalid URI' ) ; } $ scheme = parse_url ( $ uri , PHP_URL_SCHEME ) ; $ scheme = $ this -> validateScheme ( $ scheme ) ; $ host = parse_url ( $ uri , PHP_URL_HOST ) ; if ( ! $ host ) { throw new InvalidArgumentException ( "Invalid host" ) ; } $ port = parse_url ( $ uri , PHP_URL_PORT ) ; if ( ! $ port ) { $ port = $ this -> getPort ( $ scheme ) ; } return [ $ scheme , $ host , $ port ] ; }
Validates a socket URI

@param string $uri
@throws InvalidArgumentException
@return array(string $scheme, string $host, string $port)
Validates a socket URI