Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit 2d2ee48

Browse files
Merge pull request #11 from weierophinney/hotfix/config-collision
Fix collisions between $config property of OAuth client and HTTP client
2 parents e7f51c9 + fb22398 commit 2d2ee48

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Client.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Client extends HttpClient
3434
*
3535
* @var Config\StandardConfig
3636
*/
37-
protected $config = null;
37+
protected $oauthConfig = null;
3838

3939
/**
4040
* True if this request is being made with data supplied by
@@ -57,12 +57,12 @@ class Client extends HttpClient
5757
public function __construct($oauthOptions, $uri = null, $config = null)
5858
{
5959
parent::__construct($uri, $config);
60-
$this->config = new Config\StandardConfig;
60+
$this->oauthConfig = new Config\StandardConfig();
6161
if ($oauthOptions !== null) {
6262
if ($oauthOptions instanceof Traversable) {
6363
$oauthOptions = ArrayUtils::iteratorToArray($oauthOptions);
6464
}
65-
$this->config->setOptions($oauthOptions);
65+
$this->oauthConfig->setOptions($oauthOptions);
6666
}
6767
}
6868

@@ -193,7 +193,7 @@ public function prepareOAuth()
193193
case OAuth::REQUEST_SCHEME_HEADER:
194194
$oauthHeaderValue = $this->getToken()->toHeader(
195195
$this->getRequest()->getUriString(),
196-
$this->config,
196+
$this->oauthConfig,
197197
$this->getSignableParameters()
198198
);
199199
$requestHeaders = $this->getRequest()->getHeaders();
@@ -209,7 +209,7 @@ public function prepareOAuth()
209209
}
210210
$query = $this->getToken()->toQueryString(
211211
$this->getRequest()->getUriString(),
212-
$this->config,
212+
$this->oauthConfig,
213213
$this->getSignableParameters()
214214
);
215215

@@ -218,7 +218,7 @@ public function prepareOAuth()
218218
case OAuth::REQUEST_SCHEME_QUERYSTRING:
219219
$query = $this->getToken()->toQueryString(
220220
$this->getRequest()->getUriString(),
221-
$this->config,
221+
$this->oauthConfig,
222222
$this->getSignableParameters()
223223
);
224224

@@ -261,9 +261,9 @@ protected function getSignableParameters()
261261
*/
262262
public function __call($method, array $args)
263263
{
264-
if (! method_exists($this->config, $method)) {
264+
if (! method_exists($this->oauthConfig, $method)) {
265265
throw new Exception\BadMethodCallException('Method does not exist: ' . $method);
266266
}
267-
return call_user_func_array([$this->config, $method], $args);
267+
return call_user_func_array([$this->oauthConfig, $method], $args);
268268
}
269269
}

0 commit comments

Comments
 (0)