src/Url.php
public function withPath(UrlPathInterface $path): UrlInterface
    {
        return new self($this->myScheme, $this->myHost, $this->myPort, $this->myPath->withUrlPath($path), $this->myQueryString, $this->myFragment);
    }
public function withPath(UrlPathInterface $path): UrlInterface
    {
        return new self($this->myScheme, $this->myHost, $this->myPort, $this->myPath->withUrlPath($path), $this->myQueryString, $this->myFragment);
    }
public function withPath ( UrlPathInterface $ path ) : UrlInterface { return new self ( $ this -> myScheme , $ this -> myHost , $ this -> myPort , $ this -> myPath -> withUrlPath ( $ path ) , $ this -> myQueryString , $ this -> myFragment ) ; }
Returns a copy of the Url instance with the specified path.

@since 1.0.0

@param UrlPathInterface $path The path.

@return UrlInterface The Url instance.
Returns a copy of the Url instance with the specified path .