original_string: public function format($root, $path, $route = null)
      {
          $path = '/'.trim($path, '/');
  
          if ($this->formatHostUsing) {
              $root = call_user_func($this->formatHostUsing, $root, $route);
          }
  
          if ($this->formatPathUsing) {
              $path = call_user_func($this->formatPathUsing, $path, $route);
          }
  
          return trim($root.$path, '/');
      }
code: public function format($root, $path, $route = null)
      {
          $path = '/'.trim($path, '/');
  
          if ($this->formatHostUsing) {
              $root = call_user_func($this->formatHostUsing, $root, $route);
          }
  
          if ($this->formatPathUsing) {
              $path = call_user_func($this->formatPathUsing, $path, $route);
          }
  
          return trim($root.$path, '/');
      }
code_tokens: public function format ( $ root , $ path , $ route = null ) { $ path = '/' . trim ( $ path , '/' ) ; if ( $ this -> formatHostUsing ) { $ root = call_user_func ( $ this -> formatHostUsing , $ root , $ route ) ; } if ( $ this -> formatPathUsing ) { $ path = call_user_func ( $ this -> formatPathUsing , $ path , $ route ) ; } return trim ( $ root . $ path , '/' ) ; }
docstring: Format the given URL segments into a single URL.
  
  @param  string  $root
  @param  string  $path
  @param  \Illuminate\Routing\Route|null  $route
  @return string
docstring_tokens: Format the given URL segments into a single URL .