public function process($uri)
    {
        $interface = $this->getUriInterface($uri);
        $new_uri = $this->execute($uri);
        if ($new_uri instanceof $interface) {
            return $new_uri;
        }

        throw Exception::fromInvalidInterface($interface, $new_uri);
    }
public function process($uri)
    {
        $interface = $this->getUriInterface($uri);
        $new_uri = $this->execute($uri);
        if ($new_uri instanceof $interface) {
            return $new_uri;
        }

        throw Exception::fromInvalidInterface($interface, $new_uri);
    }
public function process ( $ uri ) { $ interface = $ this -> getUriInterface ( $ uri ) ; $ new_uri = $ this -> execute ( $ uri ) ; if ( $ new_uri instanceof $ interface ) { return $ new_uri ; } throw Exception :: fromInvalidInterface ( $ interface , $ new_uri ) ; }
Process and return an Uri

This method MUST retain the state of the submitted URI instance, and return
an URI instance of the same type that contains the applied modifications.

This method MUST be transparent when dealing with error and exceptions.
It MUST not alter of silence them apart from validating its own parameters.

@param Uri|UriInterface $uri

@throws Exception If the submitted or the URI object is invalid

@return Uri|UriInterface
Process and return an Uri