Completed
Push — 2.0-dev ( 3a2b1d...9114d3 )
by Michael
13:38 queued 06:02
created
Tests/ClientTest.php 2 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -136,8 +136,7 @@  discard block
 block discarded – undo
136 136
 			$this->object->setToken($token);
137 137
 			$result = $this->object->authenticate();
138 138
 			$this->assertEquals($result, $token);
139
-		}
140
-		else
139
+		} else
141 140
 		{
142 141
 			$this->object->setOption('requestTokenURL', 'https://example.com/request_token');
143 142
 			$this->object->setOption('authoriseURL', 'https://example.com/authorize');
@@ -175,8 +174,7 @@  discard block
 block discarded – undo
175 174
 			{
176 175
 				TestHelper::setValue($this->object, 'version', $version);
177 176
 				$data = array('oauth_verifier' => 'verifier', 'oauth_token' => 'token');
178
-			}
179
-			else
177
+			} else
180 178
 			{
181 179
 				TestHelper::setValue($this->object, 'version', $version);
182 180
 				$data = array('oauth_token' => 'token');
@@ -302,8 +300,7 @@  discard block
 block discarded – undo
302 300
 				$this->object->oauthRequest('www.example.com', $method, array('oauth_token' => '1235'), $data, array('Content-Type' => 'multipart/form-data')),
303 301
 				$this->equalTo($returnData)
304 302
 				);
305
-		}
306
-		else
303
+		} else
307 304
 		{
308 305
 			$this->client->expects($this->at(0))
309 306
 				->method($method)
Please login to merge, or discard this patch.
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.
src/Client.php 2 patches
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
 			$oauth_headers = $parameters;
285
-		}
286
-		else
284
+		} else
287 285
 		{
288 286
 			// Use all parameters for the signature.
289 287
 			$oauth_headers = array_merge($parameters, $data);
@@ -355,8 +353,7 @@  discard block
 block discarded – undo
355 353
 			if (!strcmp($header, 'OAuth '))
356 354
 			{
357 355
 				$header .= $key . '="' . $this->safeEncode($value) . '"';
358
-			}
359
-			else
356
+			} else
360 357
 			{
361 358
 				$header .= ', ' . $key . '="' . $value . '"';
362 359
 			}
@@ -386,16 +383,14 @@  discard block
 block discarded – undo
386 383
 					if (strpos($url, '?') === false)
387 384
 					{
388 385
 						$url .= '?';
389
-					}
390
-					else
386
+					} else
391 387
 					{
392 388
 						$url .= '&';
393 389
 					}
394 390
 
395 391
 					$url .= $key . '=' . $v;
396 392
 				}
397
-			}
398
-			else
393
+			} else
399 394
 			{
400 395
 				if (strpos($value, ' ') !== false)
401 396
 				{
@@ -405,8 +400,7 @@  discard block
 block discarded – undo
405 400
 				if (strpos($url, '?') === false)
406 401
 				{
407 402
 					$url .= '?';
408
-				}
409
-				else
403
+				} else
410 404
 				{
411 405
 					$url .= '&';
412 406
 				}
@@ -471,8 +465,7 @@  discard block
 block discarded – undo
471 465
 					$v = $this->safeEncode($v);
472 466
 					$kv[] = "{$key}={$v}";
473 467
 				}
474
-			}
475
-			else
468
+			} else
476 469
 			{
477 470
 				$value = $this->safeEncode($value);
478 471
 				$kv[] = "{$key}={$value}";
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'))
@@ -354,11 +354,11 @@  discard block
 block discarded – undo
354 354
 		{
355 355
 			if (!strcmp($header, 'OAuth '))
356 356
 			{
357
-				$header .= $key . '="' . $this->safeEncode($value) . '"';
357
+				$header .= $key.'="'.$this->safeEncode($value).'"';
358 358
 			}
359 359
 			else
360 360
 			{
361
-				$header .= ', ' . $key . '="' . $value . '"';
361
+				$header .= ', '.$key.'="'.$value.'"';
362 362
 			}
363 363
 		}
364 364
 
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 						$url .= '&';
393 393
 					}
394 394
 
395
-					$url .= $key . '=' . $v;
395
+					$url .= $key.'='.$v;
396 396
 				}
397 397
 			}
398 398
 			else
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 					$url .= '&';
412 412
 				}
413 413
 
414
-				$url .= $key . '=' . $value;
414
+				$url .= $key.'='.$value;
415 415
 			}
416 416
 		}
417 417
 
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
 	public static function generateNonce()
533 533
 	{
534 534
 		// The md5s look nicer than numbers.
535
-		return md5(microtime() . random_bytes(16));
535
+		return md5(microtime().random_bytes(16));
536 536
 	}
537 537
 
538 538
 	/**
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 	 */
545 545
 	private function prepareSigningKey()
546 546
 	{
547
-		return $this->safeEncode($this->getOption('consumer_secret')) . '&' . $this->safeEncode(($this->token) ? $this->token['secret'] : '');
547
+		return $this->safeEncode($this->getOption('consumer_secret')).'&'.$this->safeEncode(($this->token) ? $this->token['secret'] : '');
548 548
 	}
549 549
 
550 550
 	/**
Please login to merge, or discard this patch.