Completed
Push — 1.11.x ( 518476...344d9e )
by José
55:02 queued 28:13
created
plugin/buycourses/src/Requests/Proxy/HTTP.php 2 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -57,16 +57,13 @@
 block discarded – undo
57 57
 	public function __construct($args = null) {
58 58
 		if (is_string($args)) {
59 59
 			$this->proxy = $args;
60
-		}
61
-		elseif (is_array($args)) {
60
+		} elseif (is_array($args)) {
62 61
 			if (count($args) == 1) {
63 62
 				list($this->proxy) = $args;
64
-			}
65
-			elseif (count($args) == 3) {
63
+			} elseif (count($args) == 3) {
66 64
 				list($this->proxy, $this->user, $this->pass) = $args;
67 65
 				$this->use_authentication = true;
68
-			}
69
-			else {
66
+			} else {
70 67
 				throw new Requests_Exception('Invalid number of arguments', 'proxyhttpbadargs');
71 68
 			}
72 69
 		}
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 * @see fsockopen_header
54 54
 	 * @param Requests_Hooks $hooks Hook system
55 55
 	 */
56
-	public function register(Requests_Hooks &$hooks) {
56
+	public function register(Requests_Hooks & $hooks) {
57 57
 		$hooks->register('curl.before_send', array(&$this, 'curl_before_send'));
58 58
 		$hooks->register('fsockopen.after_headers', array(&$this, 'fsockopen_header'));
59 59
 	}
@@ -83,6 +83,6 @@  discard block
 block discarded – undo
83 83
 	 * @return string
84 84
 	 */
85 85
 	public function getAuthString() {
86
-		return $this->user . ':' . $this->pass;
86
+		return $this->user.':'.$this->pass;
87 87
 	}
88 88
 }
89 89
\ No newline at end of file
Please login to merge, or discard this patch.
plugin/buycourses/src/Requests/IDNAEncoder.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
 		$string = self::punycode_encode($string);
94 94
 
95 95
 		// Step 7: Prepend ACE prefix
96
-		$string = self::ACE_PREFIX . $string;
96
+		$string = self::ACE_PREFIX.$string;
97 97
 
98 98
 		// Step 8: Check size
99 99
 		if (strlen($string) < 64) {
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -291,11 +291,9 @@
 block discarded – undo
291 291
 #								tmax if k >= bias + tmax, or k - bias otherwise
292 292
 						if ($k <= ($bias + self::BOOTSTRAP_TMIN)) {
293 293
 							$t = self::BOOTSTRAP_TMIN;
294
-						}
295
-						elseif ($k >= ($bias + self::BOOTSTRAP_TMAX)) {
294
+						} elseif ($k >= ($bias + self::BOOTSTRAP_TMAX)) {
296 295
 							$t = self::BOOTSTRAP_TMAX;
297
-						}
298
-						else {
296
+						} else {
299 297
 							$t = $k - $bias;
300 298
 						}
301 299
 #						if q < t then break
Please login to merge, or discard this patch.
plugin/buycourses/src/Requests/Response.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -112,8 +112,7 @@
 block discarded – undo
112 112
 			if (!$allow_redirects) {
113 113
 				throw new Requests_Exception('Redirection not allowed', 'response.no_redirects', $this);
114 114
 			}
115
-		}
116
-		elseif (!$this->success) {
115
+		} elseif (!$this->success) {
117 116
 			$exception = Requests_Exception_HTTP::get_class($this->status_code);
118 117
 			throw new $exception(null, $this);
119 118
 		}
Please login to merge, or discard this patch.
plugin/buycourses/src/Requests/Auth/Basic.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 * @see fsockopen_header
54 54
 	 * @param Requests_Hooks $hooks Hook system
55 55
 	 */
56
-	public function register(Requests_Hooks &$hooks) {
56
+	public function register(Requests_Hooks & $hooks) {
57 57
 		$hooks->register('curl.before_send', array(&$this, 'curl_before_send'));
58 58
 		$hooks->register('fsockopen.after_headers', array(&$this, 'fsockopen_header'));
59 59
 	}
@@ -83,6 +83,6 @@  discard block
 block discarded – undo
83 83
 	 * @return string
84 84
 	 */
85 85
 	public function getAuthString() {
86
-		return $this->user . ':' . $this->pass;
86
+		return $this->user.':'.$this->pass;
87 87
 	}
88 88
 }
89 89
\ No newline at end of file
Please login to merge, or discard this patch.
plugin/buycourses/src/Requests/Cookie/Jar.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@
 block discarded – undo
162 162
 	 *
163 163
 	 * @var Requests_Response $response
164 164
 	 */
165
-	public function before_redirect_check(Requests_Response &$return) {
165
+	public function before_redirect_check(Requests_Response & $return) {
166 166
 		$url = $return->url;
167 167
 		if (!$url instanceof Requests_IRI) {
168 168
 			$url = new Requests_IRI($url);
Please login to merge, or discard this patch.
plugin/buycourses/src/Requests/Session.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -249,8 +249,7 @@
 block discarded – undo
249 249
 			if (is_array($this->data)) {
250 250
 				$request['data'] = $this->data;
251 251
 			}
252
-		}
253
-		elseif (is_array($request['data']) && is_array($this->data)) {
252
+		} elseif (is_array($request['data']) && is_array($this->data)) {
254 253
 			$request['data'] = array_merge($this->data, $request['data']);
255 254
 		}
256 255
 
Please login to merge, or discard this patch.
plugin/buycourses/src/Requests/Cookie.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -344,7 +344,7 @@
 block discarded – undo
344 344
 				}
345 345
 			}
346 346
 
347
-			$header_value .= '; ' . implode('; ', $parts);
347
+			$header_value .= '; '.implode('; ', $parts);
348 348
 		}
349 349
 		return $header_value;
350 350
 	}
Please login to merge, or discard this patch.
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -280,8 +280,7 @@  discard block
 block discarded – undo
280 280
 				$delta_seconds = (int) $value;
281 281
 				if ($delta_seconds <= 0) {
282 282
 					$expiry_time = 0;
283
-				}
284
-				else {
283
+				} else {
285 284
 					$expiry_time = $this->reference_time + $delta_seconds;
286 285
 				}
287 286
 
@@ -338,8 +337,7 @@  discard block
 block discarded – undo
338 337
 				// Ignore non-associative attributes
339 338
 				if (is_numeric($key)) {
340 339
 					$parts[] = $value;
341
-				}
342
-				else {
340
+				} else {
343 341
 					$parts[] = sprintf('%s=%s', $key, $value);
344 342
 				}
345 343
 			}
@@ -385,8 +383,7 @@  discard block
 block discarded – undo
385 383
 
386 384
 		if (!empty($name)) {
387 385
 			$value = $string;
388
-		}
389
-		elseif (strpos($kvparts, '=') === false) {
386
+		} elseif (strpos($kvparts, '=') === false) {
390 387
 			// Some sites might only have a value without the equals separator.
391 388
 			// Deviate from RFC 6265 and pretend it was actually a blank name
392 389
 			// (`=foo`)
@@ -394,8 +391,7 @@  discard block
 block discarded – undo
394 391
 			// https://bugzilla.mozilla.org/show_bug.cgi?id=169091
395 392
 			$name = '';
396 393
 			$value = $kvparts;
397
-		}
398
-		else {
394
+		} else {
399 395
 			list($name, $value) = explode('=', $kvparts, 2);
400 396
 		}
401 397
 		$name = trim($name);
@@ -409,8 +405,7 @@  discard block
 block discarded – undo
409 405
 				if (strpos($part, '=') === false) {
410 406
 					$part_key = $part;
411 407
 					$part_value = true;
412
-				}
413
-				else {
408
+				} else {
414 409
 					list($part_key, $part_value) = explode('=', $part, 2);
415 410
 					$part_value = trim($part_value);
416 411
 				}
@@ -445,8 +440,7 @@  discard block
 block discarded – undo
445 440
 			if (empty($parsed->attributes['domain']) && !empty($origin)) {
446 441
 				$parsed->attributes['domain'] = $origin->host;
447 442
 				$parsed->flags['host-only'] = true;
448
-			}
449
-			else {
443
+			} else {
450 444
 				$parsed->flags['host-only'] = false;
451 445
 			}
452 446
 
@@ -460,14 +454,12 @@  discard block
 block discarded – undo
460 454
 					// the uri-path is not a %x2F ("/") character, output
461 455
 					// %x2F ("/") and skip the remaining steps.
462 456
 					$path = '/';
463
-				}
464
-				elseif (substr_count($path, '/') === 1) {
457
+				} elseif (substr_count($path, '/') === 1) {
465 458
 					// If the uri-path contains no more than one %x2F ("/")
466 459
 					// character, output %x2F ("/") and skip the remaining
467 460
 					// step.
468 461
 					$path = '/';
469
-				}
470
-				else {
462
+				} else {
471 463
 					// Output the characters of the uri-path from the first
472 464
 					// character up to, but not including, the right-most
473 465
 					// %x2F ("/").
Please login to merge, or discard this patch.
plugin/buycourses/src/Requests/Transport/cURL.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 		$options['hooks']->dispatch('curl.before_request', array(&$this->handle));
311 311
 
312 312
 		// Force closing the connection for old versions of cURL (<7.22).
313
-		if ( ! isset( $headers['Connection'] ) ) {
313
+		if (!isset($headers['Connection'])) {
314 314
 			$headers['Connection'] = 'close';
315 315
 		}
316 316
 
@@ -505,11 +505,11 @@  discard block
 block discarded – undo
505 505
 				$query = $url_parts['query'];
506 506
 			}
507 507
 
508
-			$query .= '&' . http_build_query($data, null, '&');
508
+			$query .= '&'.http_build_query($data, null, '&');
509 509
 			$query = trim($query, '&');
510 510
 
511 511
 			if (empty($url_parts['query'])) {
512
-				$url .= '?' . $query;
512
+				$url .= '?'.$query;
513 513
 			}
514 514
 			else {
515 515
 				$url = str_replace($url_parts['query'], $query, $url);
Please login to merge, or discard this patch.
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -149,8 +149,7 @@  discard block
 block discarded – undo
149 149
 			if ($options['verify'] === false) {
150 150
 				curl_setopt($this->handle, CURLOPT_SSL_VERIFYHOST, 0);
151 151
 				curl_setopt($this->handle, CURLOPT_SSL_VERIFYPEER, 0);
152
-			}
153
-			elseif (is_string($options['verify'])) {
152
+			} elseif (is_string($options['verify'])) {
154 153
 				curl_setopt($this->handle, CURLOPT_CAINFO, $options['verify']);
155 154
 			}
156 155
 		}
@@ -246,8 +245,7 @@  discard block
 block discarded – undo
246 245
 								);
247 246
 					$responses[$key] = $exception;
248 247
 					$options['hooks']->dispatch('transport.internal.parse_error', array(&$responses[$key], $requests[$key]));
249
-				}
250
-				else {
248
+				} else {
251 249
 					$responses[$key] = $subrequests[$key]->process_response($subrequests[$key]->response_data, $options);
252 250
 
253 251
 					$options['hooks']->dispatch('transport.internal.parse_response', array(&$responses[$key], $requests[$key]));
@@ -322,8 +320,7 @@  discard block
 block discarded – undo
322 320
 			if ($data_format === 'query') {
323 321
 				$url = self::format_get($url, $data);
324 322
 				$data = '';
325
-			}
326
-			elseif (!is_string($data)) {
323
+			} elseif (!is_string($data)) {
327 324
 				$data = http_build_query($data, null, '&');
328 325
 			}
329 326
 		}
@@ -361,15 +358,13 @@  discard block
 block discarded – undo
361 358
 
362 359
 		if (is_int($timeout) || $this->version < self::CURL_7_16_2) {
363 360
 			curl_setopt($this->handle, CURLOPT_TIMEOUT, ceil($timeout));
364
-		}
365
-		else {
361
+		} else {
366 362
 			curl_setopt($this->handle, CURLOPT_TIMEOUT_MS, round($timeout * 1000));
367 363
 		}
368 364
 
369 365
 		if (is_int($options['connect_timeout']) || $this->version < self::CURL_7_16_2) {
370 366
 			curl_setopt($this->handle, CURLOPT_CONNECTTIMEOUT, ceil($options['connect_timeout']));
371
-		}
372
-		else {
367
+		} else {
373 368
 			curl_setopt($this->handle, CURLOPT_CONNECTTIMEOUT_MS, round($options['connect_timeout'] * 1000));
374 369
 		}
375 370
 		curl_setopt($this->handle, CURLOPT_URL, $url);
@@ -380,8 +375,7 @@  discard block
 block discarded – undo
380 375
 		}
381 376
 		if ($options['protocol_version'] === 1.1) {
382 377
 			curl_setopt($this->handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
383
-		}
384
-		else {
378
+		} else {
385 379
 			curl_setopt($this->handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
386 380
 		}
387 381
 
@@ -408,8 +402,7 @@  discard block
 block discarded – undo
408 402
 		if ($options['filename'] !== false) {
409 403
 			fclose($this->stream_handle);
410 404
 			$this->headers = trim($this->headers);
411
-		}
412
-		else {
405
+		} else {
413 406
 			$this->headers .= $response;
414 407
 		}
415 408
 
@@ -479,8 +472,7 @@  discard block
 block discarded – undo
479 472
 
480 473
 		if ($this->stream_handle) {
481 474
 			fwrite($this->stream_handle, $data);
482
-		}
483
-		else {
475
+		} else {
484 476
 			$this->response_data .= $data;
485 477
 		}
486 478
 
@@ -500,8 +492,7 @@  discard block
 block discarded – undo
500 492
 			$url_parts = parse_url($url);
501 493
 			if (empty($url_parts['query'])) {
502 494
 				$query = $url_parts['query'] = '';
503
-			}
504
-			else {
495
+			} else {
505 496
 				$query = $url_parts['query'];
506 497
 			}
507 498
 
@@ -510,8 +501,7 @@  discard block
 block discarded – undo
510 501
 
511 502
 			if (empty($url_parts['query'])) {
512 503
 				$url .= '?' . $query;
513
-			}
514
-			else {
504
+			} else {
515 505
 				$url = str_replace($url_parts['query'], $query, $url);
516 506
 			}
517 507
 		}
Please login to merge, or discard this patch.
plugin/buycourses/src/Requests/Transport/fsockopen.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
 		// HTTPS support
71 71
 		if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https') {
72
-			$remote_socket = 'ssl://' . $host;
72
+			$remote_socket = 'ssl://'.$host;
73 73
 			if (!isset($url_parts['port'])) {
74 74
 				$url_parts['port'] = 443;
75 75
 			}
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 			stream_context_set_option($context, array('ssl' => $context_options));
107 107
 		}
108 108
 		else {
109
-			$remote_socket = 'tcp://' . $host;
109
+			$remote_socket = 'tcp://'.$host;
110 110
 		}
111 111
 
112 112
 		$this->max_bytes = $options['max_bytes'];
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 		if (!isset($url_parts['port'])) {
115 115
 			$url_parts['port'] = 80;
116 116
 		}
117
-		$remote_socket .= ':' . $url_parts['port'];
117
+		$remote_socket .= ':'.$url_parts['port'];
118 118
 
119 119
 		set_error_handler(array($this, 'connect_error_handler'), E_WARNING | E_NOTICE);
120 120
 
@@ -174,8 +174,8 @@  discard block
 block discarded – undo
174 174
 		if (!isset($case_insensitive_headers['Host'])) {
175 175
 			$out .= sprintf('Host: %s', $url_parts['host']);
176 176
 
177
-			if (( 'http' === strtolower($url_parts['scheme']) && $url_parts['port'] !== 80 ) || ( 'https' === strtolower($url_parts['scheme']) && $url_parts['port'] !== 443 )) {
178
-				$out .= ':' . $url_parts['port'];
177
+			if (('http' === strtolower($url_parts['scheme']) && $url_parts['port'] !== 80) || ('https' === strtolower($url_parts['scheme']) && $url_parts['port'] !== 443)) {
178
+				$out .= ':'.$url_parts['port'];
179 179
 			}
180 180
 			$out .= "\r\n";
181 181
 		}
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		$headers = Requests::flatten($headers);
193 193
 
194 194
 		if (!empty($headers)) {
195
-			$out .= implode($headers, "\r\n") . "\r\n";
195
+			$out .= implode($headers, "\r\n")."\r\n";
196 196
 		}
197 197
 
198 198
 		$options['hooks']->dispatch('fsockopen.after_headers', array(&$out));
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 			$out .= "Connection: Close\r\n";
206 206
 		}
207 207
 
208
-		$out .= "\r\n" . $request_body;
208
+		$out .= "\r\n".$request_body;
209 209
 
210 210
 		$options['hooks']->dispatch('fsockopen.before_send', array(&$out));
211 211
 
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 			fclose($download);
284 284
 		}
285 285
 		else {
286
-			$this->headers .= "\r\n\r\n" . $body;
286
+			$this->headers .= "\r\n\r\n".$body;
287 287
 		}
288 288
 		fclose($socket);
289 289
 
@@ -353,12 +353,12 @@  discard block
 block discarded – undo
353 353
 				$url_parts['query'] = '';
354 354
 			}
355 355
 
356
-			$url_parts['query'] .= '&' . http_build_query($data, null, '&');
356
+			$url_parts['query'] .= '&'.http_build_query($data, null, '&');
357 357
 			$url_parts['query'] = trim($url_parts['query'], '&');
358 358
 		}
359 359
 		if (isset($url_parts['path'])) {
360 360
 			if (isset($url_parts['query'])) {
361
-				$get = $url_parts['path'] . '?' . $url_parts['query'];
361
+				$get = $url_parts['path'].'?'.$url_parts['query'];
362 362
 			}
363 363
 			else {
364 364
 				$get = $url_parts['path'];
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 			return false;
384 384
 		}
385 385
 
386
-		$this->connect_error .= $errstr . "\n";
386
+		$this->connect_error .= $errstr."\n";
387 387
 		return true;
388 388
 	}
389 389
 
Please login to merge, or discard this patch.
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -92,8 +92,7 @@  discard block
 block discarded – undo
92 92
 			if (isset($options['verify'])) {
93 93
 				if ($options['verify'] === false) {
94 94
 					$context_options['verify_peer'] = false;
95
-				}
96
-				elseif (is_string($options['verify'])) {
95
+				} elseif (is_string($options['verify'])) {
97 96
 					$context_options['cafile'] = $options['verify'];
98 97
 				}
99 98
 			}
@@ -104,8 +103,7 @@  discard block
 block discarded – undo
104 103
 			}
105 104
 
106 105
 			stream_context_set_option($context, array('ssl' => $context_options));
107
-		}
108
-		else {
106
+		} else {
109 107
 			$remote_socket = 'tcp://' . $host;
110 108
 		}
111 109
 
@@ -142,8 +140,7 @@  discard block
 block discarded – undo
142 140
 		if ($data_format === 'query') {
143 141
 			$path = self::format_get($url_parts, $data);
144 142
 			$data = '';
145
-		}
146
-		else {
143
+		} else {
147 144
 			$path = self::format_get($url_parts, array());
148 145
 		}
149 146
 
@@ -155,8 +152,7 @@  discard block
 block discarded – undo
155 152
 		if ($options['type'] !== Requests::TRACE) {
156 153
 			if (is_array($data)) {
157 154
 				$request_body = http_build_query($data, null, '&');
158
-			}
159
-			else {
155
+			} else {
160 156
 				$request_body = $data;
161 157
 			}
162 158
 
@@ -222,8 +218,7 @@  discard block
 block discarded – undo
222 218
 		$timeout_sec = (int) floor($options['timeout']);
223 219
 		if ($timeout_sec == $options['timeout']) {
224 220
 			$timeout_msec = 0;
225
-		}
226
-		else {
221
+		} else {
227 222
 			$timeout_msec = self::SECOND_IN_MICROSECONDS * $options['timeout'] % self::SECOND_IN_MICROSECONDS;
228 223
 		}
229 224
 		stream_set_timeout($socket, $timeout_sec, $timeout_msec);
@@ -271,8 +266,7 @@  discard block
 block discarded – undo
271 266
 				$size += strlen($block);
272 267
 				if ($download) {
273 268
 					fwrite($download, $block);
274
-				}
275
-				else {
269
+				} else {
276 270
 					$body .= $block;
277 271
 				}
278 272
 			}
@@ -281,8 +275,7 @@  discard block
 block discarded – undo
281 275
 
282 276
 		if ($download) {
283 277
 			fclose($download);
284
-		}
285
-		else {
278
+		} else {
286 279
 			$this->headers .= "\r\n\r\n" . $body;
287 280
 		}
288 281
 		fclose($socket);
@@ -307,8 +300,7 @@  discard block
 block discarded – undo
307 300
 				$responses[$id] = $handler->request($request['url'], $request['headers'], $request['data'], $request['options']);
308 301
 
309 302
 				$request['options']['hooks']->dispatch('transport.internal.parse_response', array(&$responses[$id], $request));
310
-			}
311
-			catch (Requests_Exception $e) {
303
+			} catch (Requests_Exception $e) {
312 304
 				$responses[$id] = $e;
313 305
 			}
314 306
 
@@ -359,12 +351,10 @@  discard block
 block discarded – undo
359 351
 		if (isset($url_parts['path'])) {
360 352
 			if (isset($url_parts['query'])) {
361 353
 				$get = $url_parts['path'] . '?' . $url_parts['query'];
362
-			}
363
-			else {
354
+			} else {
364 355
 				$get = $url_parts['path'];
365 356
 			}
366
-		}
367
-		else {
357
+		} else {
368 358
 			$get = '/';
369 359
 		}
370 360
 		return $get;
Please login to merge, or discard this patch.