/** * Constructor; creates a new HTTP Client instance which itself is * just a typical Zend_HTTP_Client subclass with some OAuth icing to * assist in automating OAuth parameter generation, addition and * cryptographic signing of requests. * * @param array|Traversable $oauthOptions * @param string $uri * @param array|Traversable $options */ public function __construct($oauthOptions, $uri = null, $config = null) { parent::__construct($uri, $config); $this->_config = new Config\StandardConfig(); if ($oauthOptions !== null) { if ($oauthOptions instanceof Traversable) { $oauthOptions = ArrayUtils::iteratorToArray($oauthOptions); } $this->_config->setOptions($oauthOptions); } }
/** * Parse option array and setup options using their * relevant mutators. * * @param array $options * @return StandardConfig */ public function setOptions(array $options) { parent::setOptions($options); foreach ($options as $key => $value) { switch ($key) { //New in oauth2.0 case 'code': $this->setCode($value); break; case 'scope': $this->setScope($value); break; case 'responseType': $this->setResponseType($value); break; case 'accessTokenFormat': $this->setAccessTokenFormat($value); break; //New in oauth2.0 end } } return $this; }