protected function baseString(Uri $url, $method = 'POST', array $parameters = array())
    {
        $baseString = rawurlencode($method).'&';

        $schemeHostPath = Uri::fromParts(array(
           'scheme' => $url->getScheme(),
           'host' => $url->getHost(),
           'path' => $url->getPath(),
        ));

        $baseString .= rawurlencode($schemeHostPath).'&';

        $data = array();
        parse_str($url->getQuery(), $query);
        $data = array_merge($query, $parameters);

        // normalize data key/values
        array_walk_recursive($data, function (&$key, &$value) {
            $key   = rawurlencode(rawurldecode($key));
            $value = rawurlencode(rawurldecode($value));
        });
        ksort($data);

        $baseString .= $this->queryStringFromData($data);

        return $baseString;
    }
protected function baseString(Uri $url, $method = 'POST', array $parameters = array())
    {
        $baseString = rawurlencode($method).'&';

        $schemeHostPath = Uri::fromParts(array(
           'scheme' => $url->getScheme(),
           'host' => $url->getHost(),
           'path' => $url->getPath(),
        ));

        $baseString .= rawurlencode($schemeHostPath).'&';

        $data = array();
        parse_str($url->getQuery(), $query);
        $data = array_merge($query, $parameters);

        // normalize data key/values
        array_walk_recursive($data, function (&$key, &$value) {
            $key   = rawurlencode(rawurldecode($key));
            $value = rawurlencode(rawurldecode($value));
        });
        ksort($data);

        $baseString .= $this->queryStringFromData($data);

        return $baseString;
    }
protected function baseString ( Uri $ url , $ method = 'POST' , array $ parameters = array ( ) ) { $ baseString = rawurlencode ( $ method ) . '&' ; $ schemeHostPath = Uri :: fromParts ( array ( 'scheme' => $ url -> getScheme ( ) , 'host' => $ url -> getHost ( ) , 'path' => $ url -> getPath ( ) , ) ) ; $ baseString .= rawurlencode ( $ schemeHostPath ) . '&' ; $ data = array ( ) ; parse_str ( $ url -> getQuery ( ) , $ query ) ; $ data = array_merge ( $ query , $ parameters ) ; // normalize data key/values array_walk_recursive ( $ data , function ( & $ key , & $ value ) { $ key = rawurlencode ( rawurldecode ( $ key ) ) ; $ value = rawurlencode ( rawurldecode ( $ value ) ) ; } ) ; ksort ( $ data ) ; $ baseString .= $ this -> queryStringFromData ( $ data ) ; return $ baseString ; }
Generate a base string for a HMAC-SHA1 signature
based on the given a url, method, and any parameters.

@param Url    $url
@param string $method
@param array  $parameters

@return string
Generate a base string for a HMAC - SHA1 signature based on the given a url method and any parameters .