src/Core/OAuth/OAuth1/OAuth1.php
private function prepareQueryParams($queryParameters){
       $appendedQueryParams = $this->appendOAuthPartsTo($queryParameters);

       array_walk_recursive($appendedQueryParams, function (&$key, &$value) {
         $key   = rawurlencode($key);
         $value = rawurlencode($value);
        });

       uksort($appendedQueryParams, 'strcmp');
       $pairs = [];
       foreach ($appendedQueryParams as $parameter => $value) {
           if (is_array($value)) {
               // If two or more parameters share the same name, they are sorted by their value
               // Ref: Spec: 9.1.1 (1)
               sort($value, SORT_STRING);
               foreach ($value as $duplicateValue) {
                   $pairs[] = $parameter . '=' . $duplicateValue;
               }
           } else {
               $pairs[] = $parameter . '=' . $value;
           }
       }
       // For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61)
       // Each name-value pair is separated by an '&' character (ASCII code 38)
       $resultString = implode('&', $pairs);
       $encodedString = rawurlencode($resultString);
       return $encodedString;
  }
private function prepareQueryParams($queryParameters){
       $appendedQueryParams = $this->appendOAuthPartsTo($queryParameters);

       array_walk_recursive($appendedQueryParams, function (&$key, &$value) {
         $key   = rawurlencode($key);
         $value = rawurlencode($value);
        });

       uksort($appendedQueryParams, 'strcmp');
       $pairs = [];
       foreach ($appendedQueryParams as $parameter => $value) {
           if (is_array($value)) {
               // If two or more parameters share the same name, they are sorted by their value
               // Ref: Spec: 9.1.1 (1)
               sort($value, SORT_STRING);
               foreach ($value as $duplicateValue) {
                   $pairs[] = $parameter . '=' . $duplicateValue;
               }
           } else {
               $pairs[] = $parameter . '=' . $value;
           }
       }
       // For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61)
       // Each name-value pair is separated by an '&' character (ASCII code 38)
       $resultString = implode('&', $pairs);
       $encodedString = rawurlencode($resultString);
       return $encodedString;
  }
A helper method to decide which query parameters to be included
When we append OAuth parts to the existed queryParameters. We don't add body for Query in the signature part.
POST parameters should only be included in the signature if they are of content-type "application/x-www-form-urlencoded" as with a form submission.
@param Array $queryParameters    The QueryParameters Array for format and re-order
@return String The formatted string