PayPal\Auth\Oauth\OAuthRequest::from_consumer_and_token PHP Method

from_consumer_and_token() public static method

pretty much a helper function to set up the request
public static from_consumer_and_token ( $consumer, $token, $http_method, $http_url, $parameters = null )
    public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = null)
    {
        $parameters = $parameters ? $parameters : array();
        $defaults = array("oauth_version" => OAuthRequest::$version, "oauth_timestamp" => OAuthRequest::generate_timestamp(), "oauth_consumer_key" => $consumer->key);
        if ($token) {
            $defaults['oauth_token'] = $token->key;
        }
        $parameters = array_merge($defaults, $parameters);
        ksort($parameters);
        return new OAuthRequest($http_method, $http_url, $parameters);
    }