|
@@ -89,7 +89,7 @@ discard block |
|
|
block discarded – undo |
|
89
|
89
|
*/ |
|
90
|
90
|
public function setMethod(string $method) : Authorization |
|
91
|
91
|
{ |
|
92
|
|
- switch($method) { |
|
|
92
|
+ switch ($method) { |
|
93
|
93
|
case self::METHOD_HEADER: |
|
94
|
94
|
case self::METHOD_QUERY: |
|
95
|
95
|
$this->method = $method; |
|
@@ -108,7 +108,7 @@ discard block |
|
|
block discarded – undo |
|
108
|
108
|
*/ |
|
109
|
109
|
public function __invoke(callable $handler) : callable |
|
110
|
110
|
{ |
|
111
|
|
- return function ($request, array& $stackOptions) use ($handler) { |
|
|
111
|
+ return function($request, array& $stackOptions) use ($handler) { |
|
112
|
112
|
|
|
113
|
113
|
// Skip to the next handler if we weren't asked to do any stuff. |
|
114
|
114
|
if (!isset($stackOptions['oauth1'])) { |
|
@@ -119,7 +119,7 @@ discard block |
|
|
block discarded – undo |
|
119
|
119
|
// so we might just as well make all the parameters we gather and append more easily accessible |
|
120
|
120
|
// by pushing into the $stackOptions directly in case there actually *are* handlers in the stack |
|
121
|
121
|
// that have to do some post-processing after us. |
|
122
|
|
- $handlerOptions =& $stackOptions['oauth1'] ?: $stackOptions['oauth1'] = []; |
|
|
122
|
+ $handlerOptions = & $stackOptions['oauth1'] ?: $stackOptions['oauth1'] = []; |
|
123
|
123
|
|
|
124
|
124
|
$this->parseOptions($handlerOptions); |
|
125
|
125
|
$this->gatherAuthorizationParams($handlerOptions); |
|
@@ -187,7 +187,7 @@ discard block |
|
|
block discarded – undo |
|
187
|
187
|
// Unite our base parameters (which cannot be overridden) with the optional ones passed in. |
|
188
|
188
|
$options['params'] = [ |
|
189
|
189
|
'oauth_version' => '1.0', |
|
190
|
|
- 'oauth_consumer_key' => isset($options['client']) ? $options['client']->getId() : $this->client->getId(), |
|
|
190
|
+ 'oauth_consumer_key' => isset($options['client']) ? $options['client']->getId() : $this->client->getId(), |
|
191
|
191
|
'oauth_signature_method' => isset($options['signer']) ? $options['signer']->getMethod() : $this->signer->getMethod(), |
|
192
|
192
|
'oauth_nonce' => utils\Random::string(6, utils\str\Character::CHARS_BASE64, utils\Random::STRENGTH_NONE), |
|
193
|
193
|
'oauth_timestamp' => time(), |
|
@@ -251,7 +251,7 @@ discard block |
|
|
block discarded – undo |
|
251
|
251
|
$params[$key] = $key.'="'.rawurlencode($value).'"'; |
|
252
|
252
|
} |
|
253
|
253
|
|
|
254
|
|
- return $request->withHeader('Authorization', 'OAuth ' . implode(', ', $params)); |
|
|
254
|
+ return $request->withHeader('Authorization', 'OAuth '.implode(', ', $params)); |
|
255
|
255
|
} |
|
256
|
256
|
|
|
257
|
257
|
/** |