protected function _normalizedParams($request, $oauthValues)
    {
        $query = parse_url($request->getUri(), PHP_URL_QUERY);
        parse_str($query, $queryArgs);

        $post = [];
        $body = $request->body();
        if (is_string($body) && $request->getHeaderLine('content-type') === 'application/x-www-form-urlencoded') {
            parse_str($body, $post);
        }
        if (is_array($body)) {
            $post = $body;
        }

        $args = array_merge($queryArgs, $oauthValues, $post);
        $pairs = $this->_normalizeData($args);
        $data = [];
        foreach ($pairs as $pair) {
            $data[] = implode('=', $pair);
        }
        sort($data, SORT_STRING);

        return implode('&', $data);
    }
protected function _normalizedParams($request, $oauthValues)
    {
        $query = parse_url($request->getUri(), PHP_URL_QUERY);
        parse_str($query, $queryArgs);

        $post = [];
        $body = $request->body();
        if (is_string($body) && $request->getHeaderLine('content-type') === 'application/x-www-form-urlencoded') {
            parse_str($body, $post);
        }
        if (is_array($body)) {
            $post = $body;
        }

        $args = array_merge($queryArgs, $oauthValues, $post);
        $pairs = $this->_normalizeData($args);
        $data = [];
        foreach ($pairs as $pair) {
            $data[] = implode('=', $pair);
        }
        sort($data, SORT_STRING);

        return implode('&', $data);
    }
protected function _normalizedParams ( $ request , $ oauthValues ) { $ query = parse_url ( $ request -> getUri ( ) , PHP_URL_QUERY ) ; parse_str ( $ query , $ queryArgs ) ; $ post = [ ] ; $ body = $ request -> body ( ) ; if ( is_string ( $ body ) && $ request -> getHeaderLine ( 'content-type' ) === 'application/x-www-form-urlencoded' ) { parse_str ( $ body , $ post ) ; } if ( is_array ( $ body ) ) { $ post = $ body ; } $ args = array_merge ( $ queryArgs , $ oauthValues , $ post ) ; $ pairs = $ this -> _normalizeData ( $ args ) ; $ data = [ ] ; foreach ( $ pairs as $ pair ) { $ data [ ] = implode ( '=' , $ pair ) ; } sort ( $ data , SORT_STRING ) ; return implode ( '&' , $ data ) ; }
Sorts and normalizes request data and oauthValues

Section 9.1.1 of Oauth spec.

- URL encode keys + values.
- Sort keys & values by byte value.

@param \Cake\Http\Client\Request $request The request object.
@param array $oauthValues Oauth values.
@return string sorted and normalized values
Sorts and normalizes request data and oauthValues