original_string: public function addPath($relativePath)
      {
          if (!$relativePath || $relativePath == '/') {
              return $this;
          }
  
          // Add a leading slash if needed
          if ($relativePath[0] != '/') {
              $relativePath = '/' . $relativePath;
          }
  
          return $this->setPath(str_replace('//', '/', $this->getPath() . $relativePath));
      }
code: public function addPath($relativePath)
      {
          if (!$relativePath || $relativePath == '/') {
              return $this;
          }
  
          // Add a leading slash if needed
          if ($relativePath[0] != '/') {
              $relativePath = '/' . $relativePath;
          }
  
          return $this->setPath(str_replace('//', '/', $this->getPath() . $relativePath));
      }
code_tokens: public function addPath ( $ relativePath ) { if ( ! $ relativePath || $ relativePath == '/' ) { return $ this ; } // Add a leading slash if needed if ( $ relativePath [ 0 ] != '/' ) { $ relativePath = '/' . $ relativePath ; } return $ this -> setPath ( str_replace ( '//' , '/' , $ this -> getPath ( ) . $ relativePath ) ) ; }
docstring: Add a relative path to the currently set path
  
  @param string $relativePath Relative path to add
  
  @return Url
docstring_tokens: Add a relative path to the currently set path