original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Returns instance with given path.
  
  @param string $path
  
  @throws \InvalidArgumentException
  
  @return UriInterface
docstring_tokens: Returns instance with given path .