Build the base string based off the values that are passed in

@param array $oauthParams
@return string
325522
public function buildBaseString(array $oauthParams)
    {
        $tempArray = array();
        ksort($oauthParams);

        if ($oauthParams['oauth_callback'] === '') {
            unset($oauthParams['oauth_callback']);
        }

        if ($oauthParams['oauth_verifier'] === '') {
            unset($oauthParams['oauth_verifier']);
        }

        array_walk($oauthParams, function($value, $key) use (&$tempArray) {
            $tempArray[] = $key . '=' . rawurlencode($value);
        });

        $parsedUrl = parse_url($this->resourceURL);
        $baseString = $this->httpMethod .'&';
        $baseString .= rawurlencode($parsedUrl['scheme'] . '://' . $parsedUrl['host'] . $parsedUrl['path']);
        $baseString .= (isset($parsedUrl['query'])) ? '&' . rawurlencode($parsedUrl['query']) . '%26' : '&';
        $baseString .= rawurlencode(implode('&', $tempArray));

        array_walk($this->postFields, function($value, $key) use (&$baseString) {
            $baseString .= '%26' . $key . rawurlencode('=' . $value);
        });

        return $baseString;
    }
1214019
private function _constructPdoDsn(array $params)
    {
        $dsn = 'ibm:';
        if (isset($params['host'])) {
            $dsn .= 'HOSTNAME=' . $params['host'] . ';';
        }
        if (isset($params['port'])) {
            $dsn .= 'PORT=' . $params['port'] . ';';
        }
        $dsn .= 'PROTOCOL=TCPIP;';
        if (isset($params['dbname'])) {
            $dsn .= 'DATABASE=' . $params['dbname'] . ';';
        }

        return $dsn;
    }
196881
private function buildAuthorizationHeader($signatureParameters) {
        $authorizationHeader = 'OAuth realm=""';
        
        foreach ($signatureParameters as $key=>$value) {
            $authorizationHeader.=','.$key."=".'"'.urlencode($value).'"';
        }
        return $authorizationHeader;
    }
254803
function buildPostString( $queryParams )
    {
        foreach ( $queryParams as $name => $value )
        {
            if ( is_array( $value ) )
            {
                foreach ( $value as $valueKey => $valuePart )
                {
                    $encodedQueryParams[] = urlencode( $name ) . '=' . urlencode( $valuePart );
                }
            }
            else
            {
                $encodedQueryParams[] = urlencode( $name ) . '=' . urlencode( $value );
            }
        }
        return implode( '&', $encodedQueryParams );
    }
1153965
protected function composeSignatureBaseString($method, $url, array $params)
    {
        if (strpos($url, '?') !== false) {
            list($url, $queryString) = explode('?', $url, 2);
            parse_str($queryString, $urlParams);
            $params = array_merge($urlParams, $params);
        }
        unset($params['oauth_signature']);
        uksort($params, 'strcmp'); // Parameters are sorted by name, using lexicographical byte value ordering. Ref: Spec: 9.1.1
        $parts = [
            strtoupper($method),
            $url,
            http_build_query($params, '', '&', PHP_QUERY_RFC3986)
        ];
        $parts = array_map('rawurlencode', $parts);

        return implode('&', $parts);
    }
973562
public static function token($params = null, $opts = null)
    {
        $base = ($opts && array_key_exists('connect_base', $opts)) ? $opts['connect_base'] : Stripe::$connectBase;
        $requestor = new ApiRequestor(null, $base);
        list($response, $apiKey) = $requestor->request(
            'post',
            '/oauth/token',
            $params,
            null
        );
        return Util\Util::convertToStripeObject($response->json, $opts);
    }
87850
public function setOAuthParameters(array $oauthParameters)
    {
        foreach ($oauthParameters as $name => $value) {
            $this->setOAuthParameter($name, $value);
        }
    }
981566
public function buildQueryString($args = array()) {
		$args = array_merge($args, array("token" => $this->token));
		
		$query = "";
		if (isset($args)) {
			while (list($key, $val) = each($args)) {
				if ( strlen($query) > 0 ) {
					$query .= "&";
				} else {
					$query .= "?";
				}
				$query .= $key . '=' . $val;
			}
		}
		return $query;
	}
1170112
public function buildFullAuthorizationUri(OAuth2 $oAuth2, $offlineAccess = false, $params = [])
    {
        $defaults = [];

        $params = array_merge(
            $defaults,
            $params
        );

        if ($offlineAccess) {
            $params['access_type'] = 'offline';
        }

        return $oAuth2->buildFullAuthorizationUri($params);
    }
697174
protected function _constructBaseUrl($servlet, $params = array())
    {
        if (count($params))
        {
            //escape all parameters appropriately for inclusion in the query string
            $escapedParams = array();

            foreach ($params as $key => $value)
            {
                $escapedParams[] = urlencode($key) . '=' . urlencode($value);
            }

            $queryString = $this->_queryDelimiter . implode($this->_queryStringDelimiter, $escapedParams);
        }
        else
        {
            $queryString = '';
        }
        
        if (!$this->_basePath) {
            throw new Exception('Please provide a base path');
        }

        $protocol = 'http://';
        if ($this->_useHttps) {
            $protocol = 'https://';
        }
        return $protocol . $this->_host . ':' . $this->_port . $this->_basePath . $servlet . $queryString;
    }
1121907
private function getOAuthParams()
    {
        //this needs to be stateful until the request is signed, then it gets unset
        if (! isset($this->oauth_params)) {
            $this->oauth_params = [
                'oauth_consumer_key' => $this->getConsumerKey(),
                'oauth_signature_method' => $this->getSignatureMethod(),
                'oauth_timestamp' => $this->getTimestamp(),
                'oauth_nonce' => $this->getNonce(),
                'oauth_callback' => $this->getCallback(),
                'oauth_version' => self::OAUTH_VERSION,
            ];

            if (null !== $token = $this->getToken()) {
                $this->oauth_params['oauth_token'] = $token;
            }
            if (null !== $verifier = $this->getVerifier()) {
                $this->oauth_params['oauth_verifier'] = $verifier;
            }
        }

        return $this->oauth_params;
    }
666493
public function addOAuthProvider($params = array())
    {
        $params = $this->checkFilterParams($params, array('type', 'provider_consumer_key', 'provider_consumer_secret'),
            array('type', 'provider_consumer_key', 'provider_consumer_secret'));
        if ($params === false) {
            throw new \InvalidArgumentException("params array contains invalid parameters or misses required parameters");
        }

        return $this->lastRequest->post(null, 'oauth_providers', $params);
    }
496010
protected function composeAuthorizationHeader(array $params, $realm = '')
    {
        $header = 'OAuth';
        $headerParams = [];
        if (!empty($realm)) {
            $headerParams[] = 'realm="' . rawurlencode($realm) . '"';
        }
        foreach ($params as $key => $value) {
            if (substr_compare($key, 'oauth', 0, 5)) {
                continue;
            }
            $headerParams[] = rawurlencode($key) . '="' . rawurlencode($value) . '"';
        }
        if (!empty($headerParams)) {
            $header .= ' ' . implode(', ', $headerParams);
        }

        return ['Authorization' => $header];
    }
68847
protected function _getAuthParam()
    {
        if(!isset($this->__auth_param))
        {
            $this->__auth_param = null;

            $request = $this->getObject('request');

            if($request->headers->has('Authorization'))
            {
                $authorization = $request->headers->get('Authorization');

                if (stripos($authorization, 'basic') === 0)
                {
                    $exploded = explode(':', base64_decode(substr($authorization, 6)));

                    if (count($exploded) == 2) {
                        $this->__auth_param = array($exploded[0], $exploded[1]);
                    }
                }
            }
        }

        return $this->__auth_param;
    }
620476
private function constructPdoDsn(array $params)
    {
        $dsn = 'oci:dbname=' . $this->getEasyConnectString($params);

        if (isset($params['charset'])) {
            $dsn .= ';charset=' . $params['charset'];
        }

        return $dsn;
    }
808363
public function buildUriWithQuery($uri, array $params = [])
    {
        $uri = uri_for($uri);

        if (!Uri::isAbsolute($uri)) {
            $uri = $uri->withScheme($this->baseURL->getScheme())
                ->withUserInfo($this->baseURL->getUserInfo())
                ->withHost($this->baseURL->getHost())
                ->withPort($this->baseURL->getPort());
        }

        $default = [
            'username' => $this->username,
            'password' => $this->password,
        ];

        return $uri->withQuery(build_query(array_merge($default, $params)));
    }
881675
public function composeUri($params)
    {
        $ret   = [];

        foreach ($params as $param => $values) {
            $internal = $param;
            if ($external = $this->translateKeyOutput($param)) {
                $param = $external;
            }
            $ret[$param] = [];
            foreach ($values as $value) {
                if ($external = $this->translateValueOutput($internal, $value)) {
                    $value = $external;
                }
                $ret[$param][] = $value;
            }
        }

        return http_build_query($ret);
    }