original_string: protected function buildUrl(array $segments = [])
      {
          //Get the base URL and add a ?
          $url = $this->apiBase.'?';
  
          if (isset($this->apiEnding)) {
              $segments = array_merge($segments, $this->apiEnding);
          }
  
          foreach ($segments as $key => $value) {
              $url = $url."$key=$value&";
          }
  
          //Remove the final &
          $url = substr($url, 0, -1);
  
          return $url;
      }
code: protected function buildUrl(array $segments = [])
      {
          //Get the base URL and add a ?
          $url = $this->apiBase.'?';
  
          if (isset($this->apiEnding)) {
              $segments = array_merge($segments, $this->apiEnding);
          }
  
          foreach ($segments as $key => $value) {
              $url = $url."$key=$value&";
          }
  
          //Remove the final &
          $url = substr($url, 0, -1);
  
          return $url;
      }
code_tokens: protected function buildUrl ( array $ segments = [ ] ) { //Get the base URL and add a ? $ url = $ this -> apiBase . '?' ; if ( isset ( $ this -> apiEnding ) ) { $ segments = array_merge ( $ segments , $ this -> apiEnding ) ; } foreach ( $ segments as $ key => $ value ) { $ url = $ url . "$key=$value&" ; } //Remove the final & $ url = substr ( $ url , 0 , - 1 ) ; return $ url ; }
docstring: Builds a URL.
  
  @param array $segments
  
  @return string
docstring_tokens: Builds a URL .