private static function filterUri($uri)
    {
        if ($uri instanceof Psr7UriInterface || $uri instanceof UriInterface) {
            return $uri;
        }

        throw new TypeError(sprintf('The uri must be a valid URI object received `%s`', is_object($uri) ? get_class($uri) : gettype($uri)));
    }
private static function filterUri($uri)
    {
        if ($uri instanceof Psr7UriInterface || $uri instanceof UriInterface) {
            return $uri;
        }

        throw new TypeError(sprintf('The uri must be a valid URI object received `%s`', is_object($uri) ? get_class($uri) : gettype($uri)));
    }
private static function filterUri ( $ uri ) { if ( $ uri instanceof Psr7UriInterface || $ uri instanceof UriInterface ) { return $ uri ; } throw new TypeError ( sprintf ( 'The uri must be a valid URI object received `%s`' , is_object ( $ uri ) ? get_class ( $ uri ) : gettype ( $ uri ) ) ) ; }
Filter the URI object.

To be valid an URI MUST implement at least one of the following interface:
- League\Uri\UriInterface
- Psr\Http\Message\UriInterface

@param mixed $uri the URI to validate

@throws TypeError if the URI object does not implements the supported interfaces.

@return Psr7UriInterface|UriInterface
Filter the URI object .