original_string: private function prepareParametersUrl(array $params, array $allowedParams)
      {
          $allowedParams = array_flip($allowedParams);
          $params = array_intersect_key($params, $allowedParams);
  
          $paramsUrlItems = [];
          foreach ($params as $key => $param) {
              $paramsUrlItems[] = $key . '=' . urlencode($param);
          }
  
          $paramsUrl = join('&', $paramsUrlItems);
          if (strlen($paramsUrl) > 0) {
              $paramsUrl = '?' . $paramsUrl;
          }
  
          return $paramsUrl;
      }
code: private function prepareParametersUrl(array $params, array $allowedParams)
      {
          $allowedParams = array_flip($allowedParams);
          $params = array_intersect_key($params, $allowedParams);
  
          $paramsUrlItems = [];
          foreach ($params as $key => $param) {
              $paramsUrlItems[] = $key . '=' . urlencode($param);
          }
  
          $paramsUrl = join('&', $paramsUrlItems);
          if (strlen($paramsUrl) > 0) {
              $paramsUrl = '?' . $paramsUrl;
          }
  
          return $paramsUrl;
      }
code_tokens: private function prepareParametersUrl ( array $ params , array $ allowedParams ) { $ allowedParams = array_flip ( $ allowedParams ) ; $ params = array_intersect_key ( $ params , $ allowedParams ) ; $ paramsUrlItems = [ ] ; foreach ( $ params as $ key => $ param ) { $ paramsUrlItems [ ] = $ key . '=' . urlencode ( $ param ) ; } $ paramsUrl = join ( '&' , $ paramsUrlItems ) ; if ( strlen ( $ paramsUrl ) > 0 ) { $ paramsUrl = '?' . $ paramsUrl ; } return $ paramsUrl ; }
docstring: Prepares params url that can be appended to request.
  
  @param array $params
  @param array $allowedParams
  @return string
docstring_tokens: Prepares params url that can be appended to request .