Passed
Branch develop (d6f62e)
by Tito
06:29
created
extensions/libraries/redcore/webservices/base.php 1 patch
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -96,15 +96,13 @@  discard block
 block discarded – undo
96 96
 				{
97 97
 					$recreate = true;
98 98
 				}
99
-			}
100
-			elseif (isset($this->token['expireTimeFormatted']))
99
+			} elseif (isset($this->token['expireTimeFormatted']))
101 100
 			{
102 101
 				if ($this->token['expireTimeFormatted'] <= date('Y-m-d H:i:s'))
103 102
 				{
104 103
 					$recreate = true;
105 104
 				}
106
-			}
107
-			elseif (isset($this->token['expires']))
105
+			} elseif (isset($this->token['expires']))
108 106
 			{
109 107
 				if ($this->token['expires'] <= date('Y-m-d H:i:s'))
110 108
 				{
@@ -204,8 +202,7 @@  discard block
 block discarded – undo
204 202
 				if (strpos($url, '?'))
205 203
 				{
206 204
 					$url .= '&';
207
-				}
208
-				else
205
+				} else
209 206
 				{
210 207
 					$url .= '?1=1';
211 208
 				}
@@ -231,8 +228,7 @@  discard block
 block discarded – undo
231 228
 			if ($response->headers['Content-Type'] == 'application/json')
232 229
 			{
233 230
 				$token = array_merge(json_decode($response->body, true), array('created' => time()));
234
-			}
235
-			else
231
+			} else
236 232
 			{
237 233
 				parse_str($response->body, $token);
238 234
 				$token = array_merge($token, array('created' => time()));
@@ -241,8 +237,7 @@  discard block
 block discarded – undo
241 237
 			$this->setToken($token);
242 238
 
243 239
 			return $this->token;
244
-		}
245
-		else
240
+		} else
246 241
 		{
247 242
 			throw new Exception('Error code ' . $response->code . ' received refreshing token: ' . $response->body . '.');
248 243
 		}
@@ -277,8 +272,7 @@  discard block
 block discarded – undo
277 272
 			if ($response->headers['Content-Type'] == 'application/json')
278 273
 			{
279 274
 				$token = array_merge(json_decode($response->body, true), array('created' => time()));
280
-			}
281
-			else
275
+			} else
282 276
 			{
283 277
 				parse_str($response->body, $token);
284 278
 				$token = array_merge($token, array('created' => time()));
@@ -287,8 +281,7 @@  discard block
 block discarded – undo
287 281
 			$this->setToken($token);
288 282
 
289 283
 			return $this->token;
290
-		}
291
-		else
284
+		} else
292 285
 		{
293 286
 			throw new Exception('Error code ' . $response->code . ' received refreshing token: ' . $response->body . '.');
294 287
 		}
@@ -320,12 +313,10 @@  discard block
 block discarded – undo
320 313
 		if (!$token || !array_key_exists('access_token', $token))
321 314
 		{
322 315
 			return false;
323
-		}
324
-		elseif (array_key_exists('expires_in', $token) && $token['created'] + $token['expires_in'] < time() + 20)
316
+		} elseif (array_key_exists('expires_in', $token) && $token['created'] + $token['expires_in'] < time() + 20)
325 317
 		{
326 318
 			return false;
327
-		}
328
-		else
319
+		} else
329 320
 		{
330 321
 			return true;
331 322
 		}
Please login to merge, or discard this patch.
extensions/libraries/redcore/webservices/webservice.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,14 +44,12 @@  discard block
 block discarded – undo
44 44
 				if ($this->getOption('authmethod', 'bearer') == 'bearer')
45 45
 				{
46 46
 					$headers['Authorization'] = 'Bearer ' . $token['access_token'];
47
-				}
48
-				elseif ($this->getOption('authmethod', 'bearer') == 'get')
47
+				} elseif ($this->getOption('authmethod', 'bearer') == 'get')
49 48
 				{
50 49
 					if (strpos($url, '?'))
51 50
 					{
52 51
 						$url .= '&';
53
-					}
54
-					else
52
+					} else
55 53
 					{
56 54
 						$url .= '?';
57 55
 					}
@@ -59,8 +57,7 @@  discard block
 block discarded – undo
59 57
 					$url .= $this->getOption('tokenparam', 'access_token') . '=' . $token['access_token'];
60 58
 				}
61 59
 			}
62
-		}
63
-		elseif ($this->getOption('authorizationtype', 'token') == 'basic')
60
+		} elseif ($this->getOption('authorizationtype', 'token') == 'basic')
64 61
 		{
65 62
 			$basic = $this->getOption('authorization.basic');
66 63
 
Please login to merge, or discard this patch.
extensions/libraries/redcore/webservices/soap.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@
 block discarded – undo
57 57
 
58 58
 			$response = $client->{$method}($data);
59 59
 			$this->outputSoapMessages($client);
60
-		}
61
-		catch (SoapFault $ex)
60
+		} catch (SoapFault $ex)
62 61
 		{
63 62
 			$this->outputSoapMessages($client);
64 63
 			throw $ex;
Please login to merge, or discard this patch.
extensions/libraries/redcore/model/admin.php 1 patch
Braces   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -90,9 +90,7 @@
 block discarded – undo
90 90
 		{
91 91
 			self::addIncludePath(JPATH_SITE . '/components/' . $option . '/models', $prefix);
92 92
 			JTable::addIncludePath(JPATH_SITE . '/components/' . $option . '/tables');
93
-		}
94
-
95
-		else
93
+		} else
96 94
 		{
97 95
 			throw new InvalidArgumentException(
98 96
 				sprintf('Cannot instantiate the model %s. Invalid client %s.', $name, $client)
Please login to merge, or discard this patch.
extensions/libraries/redcore/model/model.php 1 patch
Braces   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -98,9 +98,7 @@
 block discarded – undo
98 98
 		{
99 99
 			self::addIncludePath(JPATH_SITE . '/components/' . $option . '/models', $prefix);
100 100
 			JTable::addIncludePath(JPATH_SITE . '/components/' . $option . '/tables');
101
-		}
102
-
103
-		else
101
+		} else
104 102
 		{
105 103
 			throw new InvalidArgumentException(
106 104
 				sprintf('Cannot instanciate the model %s in component %s. Invalid client %s.', $name, $option, $client)
Please login to merge, or discard this patch.
extensions/libraries/redcore/model/table.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 	{
28 28
 		if (empty($config['filter_fields']))
29 29
 		{
30
-			$config['filter_fields']  = array_merge(
30
+			$config['filter_fields'] = array_merge(
31 31
 				array_keys($this->getOrderableColumns()),
32 32
 				array_values($this->getOrderableColumns())
33 33
 			);
Please login to merge, or discard this patch.
Braces   +2 added lines, -6 removed lines patch added patch discarded remove patch
@@ -64,14 +64,10 @@
 block discarded – undo
64 64
 		if (isset($filterFields['name']))
65 65
 		{
66 66
 			parent::populateState($filterFields['name'], 'DESC');
67
-		}
68
-
69
-		elseif (isset($filterFields['title']))
67
+		} elseif (isset($filterFields['title']))
70 68
 		{
71 69
 			parent::populateState($filterFields['title'], 'DESC');
72
-		}
73
-
74
-		else
70
+		} else
75 71
 		{
76 72
 			parent::populateState();
77 73
 		}
Please login to merge, or discard this patch.
extensions/libraries/redcore/model/list.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -304,8 +304,7 @@  discard block
 block discarded – undo
304 304
 								if (in_array(strtoupper($fullDirection), array('ASC', 'DESC', '')))
305 305
 								{
306 306
 									$this->setState('list.direction', $fullDirection);
307
-								}
308
-								else
307
+								} else
309 308
 								{
310 309
 									$this->setState('list.direction', $direction);
311 310
 
@@ -321,16 +320,14 @@  discard block
 block discarded – undo
321 320
 								if (in_array($fullOrdering, $this->filter_fields))
322 321
 								{
323 322
 									$this->setState('list.ordering', $fullOrdering);
324
-								}
325
-								else
323
+								} else
326 324
 								{
327 325
 									$this->setState('list.ordering', $ordering);
328 326
 
329 327
 									// Fallback to the default value
330 328
 									$value = $ordering . ' ' . $direction;
331 329
 								}
332
-							}
333
-							else
330
+							} else
334 331
 							{
335 332
 								$this->setState('list.ordering', $ordering);
336 333
 								$this->setState('list.direction', $direction);
@@ -379,8 +376,7 @@  discard block
 block discarded – undo
379 376
 					$this->setState('list.' . $name, $value);
380 377
 				}
381 378
 			}
382
-		}
383
-		else
379
+		} else
384 380
 		// Keep B/C for components previous to jform forms for filters
385 381
 		{
386 382
 			// Pre-fill the limits
@@ -471,8 +467,7 @@  discard block
 block discarded – undo
471 467
 			{
472 468
 				// Get the data for the form.
473 469
 				$data = $this->loadFormData();
474
-			}
475
-			else
470
+			} else
476 471
 			{
477 472
 				$data = array();
478 473
 			}
@@ -486,8 +481,7 @@  discard block
 block discarded – undo
486 481
 
487 482
 			// Load the data into the form after the plugins have operated.
488 483
 			$form->bind($data);
489
-		}
490
-		catch (Exception $e)
484
+		} catch (Exception $e)
491 485
 		{
492 486
 			$this->setError($e->getMessage());
493 487
 
Please login to merge, or discard this patch.
extensions/libraries/redcore/model/admin/base.php 1 patch
Braces   +3 added lines, -7 removed lines patch added patch discarded remove patch
@@ -182,8 +182,7 @@  discard block
 block discarded – undo
182 182
 			{
183 183
 				// Get the data for the form.
184 184
 				$data = $this->loadFormData();
185
-			}
186
-			else
185
+			} else
187 186
 			{
188 187
 				$data = array();
189 188
 			}
@@ -194,8 +193,7 @@  discard block
 block discarded – undo
194 193
 
195 194
 			// Load the data into the form after the plugins have operated.
196 195
 			$form->bind($data);
197
-		}
198
-		catch (Exception $e)
196
+		} catch (Exception $e)
199 197
 		{
200 198
 			$this->setError($e->getMessage());
201 199
 
@@ -247,9 +245,7 @@  discard block
 block discarded – undo
247 245
 				{
248 246
 					// Store the field error in session.
249 247
 					$session->set($this->context . '.error.' . $key, $message->getMessage());
250
-				}
251
-
252
-				else
248
+				} else
253 249
 				{
254 250
 					// Store the field error in session.
255 251
 					$session->set($this->context . '.error.' . $key, $message);
Please login to merge, or discard this patch.
extensions/libraries/redcore/view/base.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -177,8 +177,7 @@
 block discarded – undo
177 177
 			ob_end_clean();
178 178
 
179 179
 			return $this->_output;
180
-		}
181
-		else
180
+		} else
182 181
 		{
183 182
 			throw new Exception(JText::sprintf('JLIB_APPLICATION_ERROR_LAYOUTFILE_NOT_FOUND', $file), 500);
184 183
 		}
Please login to merge, or discard this patch.