Completed
Push — 2.0-dev ( 0bbd04...0efbdb )
by Michael
01:42
created
Tests/ClientTest.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -260,10 +260,10 @@
 block discarded – undo
260 260
 	}
261 261
 
262 262
 	/**
263
-	* Provides test data.
264
-	*
265
-	* @return  array
266
-	*/
263
+	 * Provides test data.
264
+	 *
265
+	 * @return  array
266
+	 */
267 267
 	public function seedOauthRequest()
268 268
 	{
269 269
 		// Method
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -144,8 +144,7 @@  discard block
 block discarded – undo
144 144
 			$this->object->setToken($token);
145 145
 			$result = $this->object->authenticate();
146 146
 			$this->assertEquals($result, $token);
147
-		}
148
-		else
147
+		} else
149 148
 		{
150 149
 			$this->object->setOption('requestTokenURL', 'https://example.com/request_token');
151 150
 			$this->object->setOption('authoriseURL', 'https://example.com/authorize');
@@ -183,8 +182,7 @@  discard block
 block discarded – undo
183 182
 			{
184 183
 				TestHelper::setValue($this->object, 'version', $version);
185 184
 				$data = array('oauth_verifier' => 'verifier', 'oauth_token' => 'token');
186
-			}
187
-			else
185
+			} else
188 186
 			{
189 187
 				TestHelper::setValue($this->object, 'version', $version);
190 188
 				$data = array('oauth_token' => 'token');
@@ -309,8 +307,7 @@  discard block
 block discarded – undo
309 307
 					array('Content-Type' => 'multipart/form-data')
310 308
 				)
311 309
 			);
312
-		}
313
-		else
310
+		} else
314 311
 		{
315 312
 			$this->client->expects($this->at(0))
316 313
 				->method($method)
Please login to merge, or discard this patch.
src/Client.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -332,7 +332,7 @@
 block discarded – undo
332 332
 	 * Method to validate a response.
333 333
 	 *
334 334
 	 * @param   string    $url       The request URL.
335
-	 * @param   Response  $response  The response to validate.
335
+	 * @param   \Joomla\Http\Response  $response  The response to validate.
336 336
 	 *
337 337
 	 * @return  void
338 338
 	 *
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -209,12 +209,12 @@  discard block
 block discarded – undo
209 209
 	 */
210 210
 	private function authorise()
211 211
 	{
212
-		$url = $this->getOption('authoriseURL') . '?oauth_token=' . $this->token['key'];
212
+		$url = $this->getOption('authoriseURL').'?oauth_token='.$this->token['key'];
213 213
 
214 214
 		if ($this->getOption('scope'))
215 215
 		{
216 216
 			$scope = \is_array($this->getOption('scope')) ? implode(' ', $this->getOption('scope')) : $this->getOption('scope');
217
-			$url .= '&scope=' . urlencode($scope);
217
+			$url .= '&scope='.urlencode($scope);
218 218
 		}
219 219
 
220 220
 		if ($this->getOption('sendheaders'))
@@ -358,11 +358,11 @@  discard block
 block discarded – undo
358 358
 		{
359 359
 			if (!strcmp($header, 'OAuth '))
360 360
 			{
361
-				$header .= $key . '="' . $this->safeEncode($value) . '"';
361
+				$header .= $key.'="'.$this->safeEncode($value).'"';
362 362
 			}
363 363
 			else
364 364
 			{
365
-				$header .= ', ' . $key . '="' . $value . '"';
365
+				$header .= ', '.$key.'="'.$value.'"';
366 366
 			}
367 367
 		}
368 368
 
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 						$url .= '&';
397 397
 					}
398 398
 
399
-					$url .= $key . '=' . $v;
399
+					$url .= $key.'='.$v;
400 400
 				}
401 401
 			}
402 402
 			else
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 					$url .= '&';
416 416
 				}
417 417
 
418
-				$url .= $key . '=' . $value;
418
+				$url .= $key.'='.$value;
419 419
 			}
420 420
 		}
421 421
 
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 	public static function generateNonce()
537 537
 	{
538 538
 		// The md5s look nicer than numbers.
539
-		return md5(microtime() . random_bytes(16));
539
+		return md5(microtime().random_bytes(16));
540 540
 	}
541 541
 
542 542
 	/**
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 	 */
549 549
 	private function prepareSigningKey(): string
550 550
 	{
551
-		return $this->safeEncode($this->getOption('consumer_secret')) . '&' . $this->safeEncode(($this->token) ? $this->token['secret'] : '');
551
+		return $this->safeEncode($this->getOption('consumer_secret')).'&'.$this->safeEncode(($this->token) ? $this->token['secret'] : '');
552 552
 	}
553 553
 
554 554
 	/**
Please login to merge, or discard this patch.
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -121,8 +121,7 @@  discard block
 block discarded – undo
121 121
 		if (strcmp($this->version, '1.0a') === 0)
122 122
 		{
123 123
 			$verifier = $this->input->get('oauth_verifier');
124
-		}
125
-		else
124
+		} else
126 125
 		{
127 126
 			$verifier = $this->input->get('oauth_token');
128 127
 		}
@@ -282,8 +281,7 @@  discard block
 block discarded – undo
282 281
 		if (isset($headers['Content-Type']) && strpos($headers['Content-Type'], 'multipart/form-data') !== false || !\is_array($data))
283 282
 		{
284 283
 			$oauthHeaders = $parameters;
285
-		}
286
-		else
284
+		} else
287 285
 		{
288 286
 			// Use all parameters for the signature.
289 287
 			$oauthHeaders = array_merge($parameters, $data);
@@ -359,8 +357,7 @@  discard block
 block discarded – undo
359 357
 			if (!strcmp($header, 'OAuth '))
360 358
 			{
361 359
 				$header .= $key . '="' . $this->safeEncode($value) . '"';
362
-			}
363
-			else
360
+			} else
364 361
 			{
365 362
 				$header .= ', ' . $key . '="' . $value . '"';
366 363
 			}
@@ -390,16 +387,14 @@  discard block
 block discarded – undo
390 387
 					if (strpos($url, '?') === false)
391 388
 					{
392 389
 						$url .= '?';
393
-					}
394
-					else
390
+					} else
395 391
 					{
396 392
 						$url .= '&';
397 393
 					}
398 394
 
399 395
 					$url .= $key . '=' . $v;
400 396
 				}
401
-			}
402
-			else
397
+			} else
403 398
 			{
404 399
 				if (strpos($value, ' ') !== false)
405 400
 				{
@@ -409,8 +404,7 @@  discard block
 block discarded – undo
409 404
 				if (strpos($url, '?') === false)
410 405
 				{
411 406
 					$url .= '?';
412
-				}
413
-				else
407
+				} else
414 408
 				{
415 409
 					$url .= '&';
416 410
 				}
@@ -475,8 +469,7 @@  discard block
 block discarded – undo
475 469
 					$v    = $this->safeEncode($v);
476 470
 					$kv[] = "{$key}={$v}";
477 471
 				}
478
-			}
479
-			else
472
+			} else
480 473
 			{
481 474
 				$value = $this->safeEncode($value);
482 475
 				$kv[]  = "{$key}={$value}";
Please login to merge, or discard this patch.