private function validate(UriInterface $uri): void
    {
        $scheme = $uri->getScheme();
        if (null === $scheme && '' === $uri->getHost()) {
            throw new SyntaxError(sprintf('an URI without scheme can not contains a empty host string according to PSR-7: %s', (string) $uri));
        }

        $port = $uri->getPort();
        if (null !== $port && ($port < 0 || $port > 65535)) {
            throw new SyntaxError(sprintf('The URI port is outside the established TCP and UDP port ranges: %s', (string) $uri->getPort()));
        }
    }
private function validate(UriInterface $uri): void
    {
        $scheme = $uri->getScheme();
        if (null === $scheme && '' === $uri->getHost()) {
            throw new SyntaxError(sprintf('an URI without scheme can not contains a empty host string according to PSR-7: %s', (string) $uri));
        }

        $port = $uri->getPort();
        if (null !== $port && ($port < 0 || $port > 65535)) {
            throw new SyntaxError(sprintf('The URI port is outside the established TCP and UDP port ranges: %s', (string) $uri->getPort()));
        }
    }
private function validate ( UriInterface $ uri ) : void { $ scheme = $ uri -> getScheme ( ) ; if ( null === $ scheme && '' === $ uri -> getHost ( ) ) { throw new SyntaxError ( sprintf ( 'an URI without scheme can not contains a empty host string according to PSR-7: %s' , ( string ) $ uri ) ) ; } $ port = $ uri -> getPort ( ) ; if ( null !== $ port && ( $ port < 0 || $ port > 65535 ) ) { throw new SyntaxError ( sprintf ( 'The URI port is outside the established TCP and UDP port ranges: %s' , ( string ) $ uri -> getPort ( ) ) ) ; } }
Validate the submitted uri against PSR-7 UriInterface.

@throws SyntaxError if the given URI does not follow PSR-7 UriInterface rules
Validate the submitted uri against PSR - 7 UriInterface .