public function setOverride($uri)
    {
        if (is_string($uri)) {
            $uri = new Uri($uri);
        }

        Assert::nullOrIsInstanceOf($uri, UriInterface::class, 'Expected a string, UriInterface, or null. Got: %s');

        $this->override = $uri;
    }
public function setOverride($uri)
    {
        if (is_string($uri)) {
            $uri = new Uri($uri);
        }

        Assert::nullOrIsInstanceOf($uri, UriInterface::class, 'Expected a string, UriInterface, or null. Got: %s');

        $this->override = $uri;
    }
public function setOverride ( $ uri ) { if ( is_string ( $ uri ) ) { $ uri = new Uri ( $ uri ) ; } Assert :: nullOrIsInstanceOf ( $ uri , UriInterface :: class , 'Expected a string, UriInterface, or null. Got: %s' ) ; $ this -> override = $ uri ; }
This overrides the the canonical url. It will be resolved against the current request.

Note: This only applies to the current request, so it will need to be called again for the next one.

@param UriInterface|string|null $uri
This overrides the the canonical url . It will be resolved against the current request .