public function withPath($path)
    {
        if (!is_string($path)) {
            throw new \InvalidArgumentException('Invalid path provided; must be a string');
        }
        $path = $this->filterPath($path);

        $new = clone $this;
        $new->path = $path;

        return $new;
    }
public function withPath($path)
    {
        if (!is_string($path)) {
            throw new \InvalidArgumentException('Invalid path provided; must be a string');
        }
        $path = $this->filterPath($path);

        $new = clone $this;
        $new->path = $path;

        return $new;
    }
public function withPath ( $ path ) { if ( ! is_string ( $ path ) ) { throw new \ InvalidArgumentException ( 'Invalid path provided; must be a string' ) ; } $ path = $ this -> filterPath ( $ path ) ; $ new = clone $ this ; $ new -> path = $ path ; return $ new ; }
Returns instance with given path.

@param string $path

@throws \InvalidArgumentException

@return UriInterface
Returns instance with given path .