original_string: private function buildQuery(string $url, string $apiKey, string $locale = null, string $region = null) : string
      {
          if (null !== $apiKey) {
              $url = sprintf('%s&key=%s', $url, $apiKey);
          }
          if (null !== $locale) {
              $url = sprintf('%s&language=%s', $url, $locale);
          }
          if (null !== $region) {
              $url = sprintf('%s&region=%s', $url, $region);
          }
  
          return $url;
      }
code: private function buildQuery(string $url, string $apiKey, string $locale = null, string $region = null) : string
      {
          if (null !== $apiKey) {
              $url = sprintf('%s&key=%s', $url, $apiKey);
          }
          if (null !== $locale) {
              $url = sprintf('%s&language=%s', $url, $locale);
          }
          if (null !== $region) {
              $url = sprintf('%s&region=%s', $url, $region);
          }
  
          return $url;
      }
code_tokens: private function buildQuery ( string $ url , string $ apiKey , string $ locale = null , string $ region = null ) : string { if ( null !== $ apiKey ) { $ url = sprintf ( '%s&key=%s' , $ url , $ apiKey ) ; } if ( null !== $ locale ) { $ url = sprintf ( '%s&language=%s' , $ url , $ locale ) ; } if ( null !== $ region ) { $ url = sprintf ( '%s&region=%s' , $ url , $ region ) ; } return $ url ; }
docstring: build query with extra params
  
  @param string $url
  @param string $locale
  @param string $region
  @param string $apiKey
  
  @return string
docstring_tokens: build query with extra params