Passed
Branch develop (d6f62e)
by Tito
06:29
created
extensions/libraries/redcore/table/table.php 1 patch
Braces   +7 added lines, -15 removed lines patch added patch discarded remove patch
@@ -685,8 +685,7 @@  discard block
 block discarded – undo
685 685
 		if (!property_exists($this, 'checked_out') || !property_exists($this, 'checked_out_time'))
686 686
 		{
687 687
 			$checkin = false;
688
-		}
689
-		else
688
+		} else
690 689
 		{
691 690
 			$query->where('(checked_out = 0 OR checked_out IS NULL OR checked_out = ' . (int) $userId . ')');
692 691
 			$checkin = true;
@@ -698,8 +697,7 @@  discard block
 block discarded – undo
698 697
 		try
699 698
 		{
700 699
 			$db->execute();
701
-		}
702
-		catch (RuntimeException $e)
700
+		} catch (RuntimeException $e)
703 701
 		{
704 702
 			JError::raiseWarning(500, $e->getMessage());
705 703
 			JLog::add(JText::sprintf('REDCORE_ERROR_QUERY', $db->dump()), JLog::ERROR, $this->_logPrefix . 'Queries');
@@ -755,8 +753,7 @@  discard block
 block discarded – undo
755 753
 				{
756 754
 					$pk[$key] = $this->$key;
757 755
 				}
758
-			}
759
-			elseif (is_array($pk))
756
+			} elseif (is_array($pk))
760 757
 			{
761 758
 				$pk = array();
762 759
 
@@ -803,8 +800,7 @@  discard block
 block discarded – undo
803 800
 			{
804 801
 				$query->where($this->_db->quoteName($k) . ' = ' . $this->_db->quote($pk[$k]));
805 802
 			}
806
-		}
807
-		else
803
+		} else
808 804
 		{
809 805
 			$query->where($this->_db->quoteName($this->_tbl_key) . ' IN (' . $pk . ')');
810 806
 		}
@@ -872,9 +868,7 @@  discard block
 block discarded – undo
872 868
 		elseif ($client === 0)
873 869
 		{
874 870
 			JTable::addIncludePath(JPATH_SITE . '/components/' . $option . '/tables');
875
-		}
876
-
877
-		else
871
+		} else
878 872
 		{
879 873
 			throw new InvalidArgumentException(
880 874
 				sprintf('Cannot instanciate the table %s in component %s. Invalid client %s.', $name, $option, $client)
@@ -1003,8 +997,7 @@  discard block
 block discarded – undo
1003 997
 			if ($user->id)
1004 998
 			{
1005 999
 				$tableInstance->{$tableFieldCreatedBy} = $user->id;
1006
-			}
1007
-			else
1000
+			} else
1008 1001
 			{
1009 1002
 				$tableInstance->{$tableFieldCreatedBy} = null;
1010 1003
 			}
@@ -1027,8 +1020,7 @@  discard block
 block discarded – undo
1027 1020
 			if ($user->id)
1028 1021
 			{
1029 1022
 				$tableInstance->{$tableFieldModifiedBy} = $user->id;
1030
-			}
1031
-			else
1023
+			} else
1032 1024
 			{
1033 1025
 				$tableInstance->{$tableFieldModifiedBy} = null;
1034 1026
 			}
Please login to merge, or discard this patch.
extensions/libraries/redcore/inflector/inflector.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -287,14 +287,12 @@  discard block
 block discarded – undo
287 287
 				if ($reset)
288 288
 				{
289 289
 					self::${$type}[$rule] = $pattern;
290
-				}
291
-				else
290
+				} else
292 291
 				{
293 292
 					if ($rule === 'uninflected')
294 293
 					{
295 294
 						self::${$type}[$rule] = array_merge($pattern, self::${$type}[$rule]);
296
-					}
297
-					else
295
+					} else
298 296
 					{
299 297
 						self::${$type}[$rule] = $pattern + self::${$type}[$rule];
300 298
 					}
@@ -310,8 +308,7 @@  discard block
 block discarded – undo
310 308
 				if ($type === 'plural')
311 309
 				{
312 310
 					self::$cache['pluralize'] = self::$cache['tableize'] = array();
313
-				}
314
-				elseif ($type === 'singular')
311
+				} elseif ($type === 'singular')
315 312
 				{
316 313
 					self::$cache['singularize'] = array();
317 314
 				}
Please login to merge, or discard this patch.
extensions/libraries/redcore/component/helper.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@
 block discarded – undo
173 173
 		if (!empty($mySqlRequired))
174 174
 		{
175 175
 			$db = JFactory::getDbo();
176
-			$dbVersion  = $db->getVersion();
176
+			$dbVersion = $db->getVersion();
177 177
 
178 178
 			if (!in_array($db->name, array('mysql', 'mysqli')))
179 179
 			{
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -79,8 +79,7 @@  discard block
 block discarded – undo
79 79
 						{
80 80
 							self::$redcoreExtensions[] = 'com_' . strstr($folderFile, '.xml', true);
81 81
 						}
82
-					}
83
-					catch (Exception $e)
82
+					} catch (Exception $e)
84 83
 					{
85 84
 						JFactory::getApplication()->enqueueMessage($e->getMessage() . ': ' . $folder . '/' . $folderFile, 'error');
86 85
 					}
@@ -178,8 +177,7 @@  discard block
 block discarded – undo
178 177
 			if (!in_array($db->name, array('mysql', 'mysqli')))
179 178
 			{
180 179
 				$status = false;
181
-			}
182
-			else
180
+			} else
183 181
 			{
184 182
 				$status = version_compare($mySqlRequired, $dbVersion, '<=');
185 183
 			}
Please login to merge, or discard this patch.
extensions/libraries/redcore/bootstrap.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@
 block discarded – undo
154 154
 			// For Joomla! 2.5 compatibility we add some core functions
155 155
 			if (version_compare(JVERSION, '3.0', '<'))
156 156
 			{
157
-				RLoader::registerPrefix('J',  JPATH_LIBRARIES . '/redcore/joomla', false, true);
157
+				RLoader::registerPrefix('J', JPATH_LIBRARIES . '/redcore/joomla', false, true);
158 158
 			}
159 159
 
160 160
 			// Make available the fields
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -192,8 +192,7 @@
 block discarded – undo
192 192
 
193 193
 				// Reset plugin translations params if needed
194 194
 				RTranslationHelper::resetPluginTranslation();
195
-			}
196
-			else
195
+			} else
197 196
 			{
198 197
 				// We still need to set translate property to avoid notices as we check it from other functions
199 198
 				$db = JFactory::getDbo();
Please login to merge, or discard this patch.
extensions/libraries/redcore/modal/modal.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -90,12 +90,10 @@
 block discarded – undo
90 90
 		if (is_array($params))
91 91
 		{
92 92
 			$this->params = new JRegistry($params);
93
-		}
94
-		elseif ($params instanceof JRegistry)
93
+		} elseif ($params instanceof JRegistry)
95 94
 		{
96 95
 			$this->params = $params;
97
-		}
98
-		else
96
+		} else
99 97
 		{
100 98
 			$this->params = new JRegistry;
101 99
 		}
Please login to merge, or discard this patch.
extensions/libraries/redcore/filesystem/file.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
 		}
64 64
 
65 65
 		JPluginHelper::importPlugin('content');
66
-		$dispatcher	= RFactory::getDispatcher();
66
+		$dispatcher = RFactory::getDispatcher();
67 67
 
68 68
 		foreach ($files as &$file)
69 69
 		{
Please login to merge, or discard this patch.
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -46,8 +46,7 @@  discard block
 block discarded – undo
46 46
 			{
47 47
 				$fileExtension = self::getExt($file['name']);
48 48
 				$file['destinationFileName'] = self::getUniqueName($file['name']) . '.' . $fileExtension;
49
-			}
50
-			else
49
+			} else
51 50
 			{
52 51
 				$file['destinationFileName'] = self::makeSafe($file['name']);
53 52
 			}
@@ -86,8 +85,7 @@  discard block
 block discarded – undo
86 85
 				$app->enqueueMessage(JText::_('LIB_REDCORE_ERROR_UNABLE_TO_UPLOAD_FILE'), 'error');
87 86
 
88 87
 				return false;
89
-			}
90
-			else
88
+			} else
91 89
 			{
92 90
 				// Trigger the onContentAfterSave event.
93 91
 				$dispatcher->trigger('onContentAfterSave', array('com_redcore.file', &$objectFile, true));
@@ -118,8 +116,7 @@  discard block
 block discarded – undo
118 116
 		if (version_compare(JVERSION, '3.0', 'ge'))
119 117
 		{
120 118
 			$serverKey = JFactory::getConfig()->get('secret', '');
121
-		}
122
-		else
119
+		} else
123 120
 		{
124 121
 			$serverKey = JFactory::getConfig()->getValue('secret', '');
125 122
 		}
@@ -129,12 +126,10 @@  discard block
 block discarded – undo
129 126
 		if (function_exists('sha256'))
130 127
 		{
131 128
 			$mangledName = sha256($sig);
132
-		}
133
-		elseif (function_exists('sha1'))
129
+		} elseif (function_exists('sha1'))
134 130
 		{
135 131
 			$mangledName = sha1($sig);
136
-		}
137
-		else
132
+		} else
138 133
 		{
139 134
 			$mangledName = md5($sig);
140 135
 		}
@@ -238,13 +233,11 @@  discard block
 block discarded – undo
238 233
 			$type  = finfo_file($finfo, $file['tmp_name']);
239 234
 
240 235
 			finfo_close($finfo);
241
-		}
242
-		elseif (function_exists('mime_content_type'))
236
+		} elseif (function_exists('mime_content_type'))
243 237
 		{
244 238
 			// We have mime magic.
245 239
 			$type = mime_content_type($file['tmp_name']);
246
-		}
247
-		else
240
+		} else
248 241
 		{
249 242
 			$type = $file['type'];
250 243
 		}
Please login to merge, or discard this patch.
extensions/libraries/redcore/form/base.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -60,8 +60,7 @@  discard block
 block discarded – undo
60 60
 				{
61 61
 					throw new RuntimeException('RForm::getInstance could not load form');
62 62
 				}
63
-			}
64
-			else
63
+			} else
65 64
 			{
66 65
 				if ($forms[$name]->loadFile($data, $replace, $xpath) == false)
67 66
 				{
@@ -118,8 +117,7 @@  discard block
 block discarded – undo
118 117
 			if ($group)
119 118
 			{
120 119
 				$value = $input->get($group . '.' . $name);
121
-			}
122
-			else
120
+			} else
123 121
 			{
124 122
 				$value = $input->get($name);
125 123
 			}
@@ -133,8 +131,7 @@  discard block
 block discarded – undo
133 131
 				if ($group)
134 132
 				{
135 133
 					$this->errors[$group . '.' . $name] = $valid;
136
-				}
137
-				else
134
+				} else
138 135
 				{
139 136
 					$this->errors[$name] = $valid;
140 137
 				}
Please login to merge, or discard this patch.
extensions/libraries/redcore/form/fields/rrules.php 1 patch
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -71,8 +71,7 @@  discard block
 block discarded – undo
71 71
 				->where($db->quoteName('name') . ' = ' . $db->quote($component));
72 72
 			$db->setQuery($query);
73 73
 			$assetId = (int) $db->loadResult();
74
-		}
75
-		else
74
+		} else
76 75
 		{
77 76
 			// Find the asset id of the content.
78 77
 			// Note that for global configuration, com_config injects asset_id = 1 into the form.
@@ -214,44 +213,37 @@  discard block
 block discarded – undo
214 213
 						if ($inheritedRule === null)
215 214
 						{
216 215
 							$html[] = '<span class="label label-important label-danger">' . JText::_('JLIB_RULES_NOT_ALLOWED') . '</span>';
217
-						}
218
-						elseif ($inheritedRule === true)
216
+						} elseif ($inheritedRule === true)
219 217
 						{
220 218
 							$html[] = '<span class="label label-success">' . JText::_('JLIB_RULES_ALLOWED') . '</span>';
221
-						}
222
-						elseif ($inheritedRule === false)
219
+						} elseif ($inheritedRule === false)
223 220
 						{
224 221
 							if ($assetRule === false)
225 222
 							{
226 223
 								$html[] = '<span class="label label-important label-danger">' . JText::_('JLIB_RULES_NOT_ALLOWED') . '</span>';
227
-							}
228
-							else
224
+							} else
229 225
 							{
230 226
 								$html[] = '<span class="label label-default"><i class="icon-lock icon-white"></i> ' . JText::_('JLIB_RULES_NOT_ALLOWED_LOCKED')
231 227
 									. '</span>';
232 228
 							}
233 229
 						}
234
-					}
235
-					elseif (!empty($component))
230
+					} elseif (!empty($component))
236 231
 					{
237 232
 						$html[] = '<span class="label label-success"><i class="icon-lock icon-white"></i> ' . JText::_('JLIB_RULES_ALLOWED_ADMIN')
238 233
 							. '</span>';
239
-					}
240
-					else
234
+					} else
241 235
 					{
242 236
 						// Special handling for  groups that have global admin because they can't  be denied.
243 237
 						// The admin rights can be changed.
244 238
 						if ($action->name === 'core.admin')
245 239
 						{
246 240
 							$html[] = '<span class="label label-success">' . JText::_('JLIB_RULES_ALLOWED') . '</span>';
247
-						}
248
-						elseif ($inheritedRule === false)
241
+						} elseif ($inheritedRule === false)
249 242
 						{
250 243
 							// Other actions cannot be changed.
251 244
 							$html[] = '<span class="label label-important label-danger"><i class="icon-lock icon-white"></i> '
252 245
 								. JText::_('JLIB_RULES_NOT_ALLOWED_ADMIN_CONFLICT') . '</span>';
253
-						}
254
-						else
246
+						} else
255 247
 						{
256 248
 							$html[] = '<span class="label label-success"><i class="icon-lock icon-white"></i> ' . JText::_('JLIB_RULES_ALLOWED_ADMIN')
257 249
 								. '</span>';
@@ -275,8 +267,7 @@  discard block
 block discarded – undo
275 267
 		if ($section == 'component' || $section == null)
276 268
 		{
277 269
 			$html[] = JText::_('JLIB_RULES_SETTING_NOTES');
278
-		}
279
-		else
270
+		} else
280 271
 		{
281 272
 			$html[] = JText::_('JLIB_RULES_SETTING_NOTES_ITEM');
282 273
 		}
Please login to merge, or discard this patch.
extensions/libraries/redcore/form/fields/ruser.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -111,8 +111,7 @@
 block discarded – undo
111 111
 		if ($this->value)
112 112
 		{
113 113
 			$table->load($this->value);
114
-		}
115
-		else
114
+		} else
116 115
 		{
117 116
 			$table->username = JText::_('JLIB_FORM_SELECT_USER');
118 117
 		}
Please login to merge, or discard this patch.