Passed
Push — 1.0.0-dev ( 83bedf...ceb5d8 )
by nguereza
02:34
created
tests/include/common.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -178,15 +178,13 @@
 block discarded – undo
178 178
 	function clean_input($str){
179 179
 		if(is_array($str)){
180 180
 			$str = array_map('clean_input', $str);
181
-		}
182
-		else if(is_object($str)){
181
+		} else if(is_object($str)){
183 182
 			$obj = $str;
184 183
 			foreach ($str as $var => $value) {
185 184
 				$obj->$var = clean_input($value);
186 185
 			}
187 186
 			$str = $obj;
188
-		}
189
-		else{
187
+		} else{
190 188
 			$str = htmlspecialchars(strip_tags($str), ENT_QUOTES, 'UTF-8');
191 189
 		}
192 190
 		return $str;
Please login to merge, or discard this patch.
core/classes/DBSessionHandler.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -87,8 +87,7 @@  discard block
 block discarded – undo
87 87
 	         */
88 88
 	        if(is_object($logger)){
89 89
 	          $this->setLogger($logger);
90
-	        }
91
-	        else{
90
+	        } else{
92 91
 	            $this->logger =& class_loader('Log', 'classes');
93 92
 	            $this->logger->setLogger('Library::DBSessionHandler');
94 93
 	        }
@@ -197,8 +196,7 @@  discard block
 block discarded – undo
197 196
 			if($this->getLoader()){
198 197
 				$this->getLoader()->functions('user_agent'); 
199 198
 				$this->getLoader()->library('Browser'); 
200
-			}
201
-			else{
199
+			} else{
202 200
             	Loader::functions('user_agent');
203 201
             	Loader::library('Browser');
204 202
             }
@@ -237,8 +235,7 @@  discard block
 block discarded – undo
237 235
 			if($this->getLoader()){
238 236
 				$this->getLoader()->functions('user_agent'); 
239 237
 				$this->getLoader()->library('Browser'); 
240
-			}
241
-			else{
238
+			} else{
242 239
             	Loader::functions('user_agent');
243 240
             	Loader::library('Browser');
244 241
             }
@@ -264,8 +261,7 @@  discard block
 block discarded – undo
264 261
 				//update
265 262
 				unset($params[$columns['sid']]);
266 263
 				$instance->update($sid, $params);
267
-			}
268
-			else{
264
+			} else{
269 265
 				$this->logger->info('Session data for SID: ' . $sid . ' not yet exists, insert it now');
270 266
 				$instance->insert($params);
271 267
 			}
Please login to merge, or discard this patch.
core/classes/cache/ApcCache.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -43,8 +43,7 @@  discard block
 block discarded – undo
43 43
 	         */
44 44
 	        if(is_object($logger)){
45 45
 	          $this->logger = $logger;
46
-	        }
47
-	        else{
46
+	        } else{
48 47
 	            $this->logger =& class_loader('Log', 'classes');
49 48
 	            $this->logger->setLogger('Library::ApcCache');
50 49
 	        }
@@ -62,8 +61,7 @@  discard block
 block discarded – undo
62 61
 			if($success === false){
63 62
 				$this->logger->info('No cache found for the key ['. $key .'], return false');
64 63
 				return false;
65
-			}
66
-			else{
64
+			} else{
67 65
 				$cacheInfo = $this->_getCacheInfo($key);
68 66
 				$expire = time();
69 67
 				if($cacheInfo){
@@ -89,8 +87,7 @@  discard block
 block discarded – undo
89 87
 			if($result === false){
90 88
 		    	$this->logger->error('Can not write cache data for the key ['. $key .'], return false');
91 89
 		    	return false;
92
-		    }
93
-		    else{
90
+		    } else{
94 91
 		    	$this->logger->info('Cache data saved for the key ['. $key .']');
95 92
 		    	return true;
96 93
 		    }
@@ -109,8 +106,7 @@  discard block
 block discarded – undo
109 106
 			if($cacheInfo === false){
110 107
 				$this->logger->info('This cache data does not exists skipping');
111 108
 				return false;
112
-			}
113
-			else{
109
+			} else{
114 110
 				$this->logger->info('Found cache data for the key [' .$key. '] remove it');
115 111
 	      		return apc_delete($key) === true;
116 112
 			}
@@ -134,8 +130,7 @@  discard block
 block discarded – undo
134 130
 							'ttl' => $cacheInfos['ttl']
135 131
 							);
136 132
 				return $data;
137
-			}
138
-			else{
133
+			} else{
139 134
 				$this->logger->info('This cache does not exists skipping');
140 135
 				return false;
141 136
 			}
@@ -159,8 +154,7 @@  discard block
 block discarded – undo
159 154
 			if(empty($cacheInfos['cache_list'])){
160 155
 				$this->logger->info('No cache data were found skipping');
161 156
 				return false;
162
-			}
163
-			else{
157
+			} else{
164 158
 				$this->logger->info('Found [' . count($cacheInfos) . '] cache data to remove');
165 159
 				return apc_clear_cache('user');
166 160
 			}
Please login to merge, or discard this patch.
core/classes/Loader.php 1 patch
Braces   +17 added lines, -34 removed lines patch added patch discarded remove patch
@@ -148,8 +148,7 @@  discard block
 block discarded – undo
148 148
 					if(isset($path[1])){
149 149
 						$instance = strtolower($path[1]);
150 150
 					}
151
-				}
152
-				else{
151
+				} else{
153 152
 					$instance = strtolower($class);
154 153
 				}
155 154
 			}
@@ -169,8 +168,7 @@  discard block
 block discarded – undo
169 168
 					$searchModuleName = $path[0];
170 169
 					$class = ucfirst($path[1]);
171 170
 				}
172
-			}
173
-			else{
171
+			} else{
174 172
 				$class = ucfirst($class);
175 173
 			}
176 174
 
@@ -181,8 +179,7 @@  discard block
 block discarded – undo
181 179
 			if($moduleModelFilePath){
182 180
 				$logger->info('Found model [' . $class . '] from module [' .$searchModuleName. '], the file path is [' .$moduleModelFilePath. '] we will used it');
183 181
 				$classFilePath = $moduleModelFilePath;
184
-			}
185
-			else{
182
+			} else{
186 183
 				$logger->info('Cannot find model [' . $class . '] from modules using the default location');
187 184
 			}
188 185
 			$logger->info('The model file path to be loaded is [' . $classFilePath . ']');
@@ -194,12 +191,10 @@  discard block
 block discarded – undo
194 191
 					$obj->{$instance} = $c;
195 192
 					static::$loaded[$instance] = $class;
196 193
 					$logger->info('Model [' . $class . '] --> ' . $classFilePath . ' loaded successfully.');
197
-				}
198
-				else{
194
+				} else{
199 195
 					show_error('The file '.$classFilePath.' exists but does not contain the class ['. $class . ']');
200 196
 				}
201
-			}
202
-			else{
197
+			} else{
203 198
 				show_error('Unable to find the model [' . $class . ']');
204 199
 			}
205 200
 		}
@@ -227,8 +222,7 @@  discard block
 block discarded – undo
227 222
 					if(isset($path[1])){
228 223
 						$instance = strtolower($path[1]);
229 224
 					}
230
-				}
231
-				else{
225
+				} else{
232 226
 					$instance = strtolower($class);
233 227
 				}
234 228
 			}
@@ -252,8 +246,7 @@  discard block
 block discarded – undo
252 246
 				$libraryFilePath = CORE_LIBRARY_PATH . $file;
253 247
 				$class = ucfirst($class);
254 248
 				$logger->info('This library is a system library');
255
-			}
256
-			else{
249
+			} else{
257 250
 				$logger->info('This library is not a system library');	
258 251
 				//first check if this library is in the module
259 252
 				$logger->debug('Checking library [' . $class . '] from module list ...');
@@ -265,8 +258,7 @@  discard block
 block discarded – undo
265 258
 						$searchModuleName = $path[0];
266 259
 						$class = ucfirst($path[1]);
267 260
 					}
268
-				}
269
-				else{
261
+				} else{
270 262
 					$class = ucfirst($class);
271 263
 				}
272 264
 				if(! $searchModuleName && !empty($obj->moduleName)){
@@ -276,8 +268,7 @@  discard block
 block discarded – undo
276 268
 				if($moduleLibraryPath){
277 269
 					$logger->info('Found library [' . $class . '] from module [' .$searchModuleName. '], the file path is [' .$moduleLibraryPath. '] we will used it');
278 270
 					$libraryFilePath = $moduleLibraryPath;
279
-				}
280
-				else{
271
+				} else{
281 272
 					$logger->info('Cannot find library [' . $class . '] from modules using the default location');
282 273
 				}
283 274
 			}
@@ -301,12 +292,10 @@  discard block
 block discarded – undo
301 292
 					$obj->{$instance} = $c;
302 293
 					static::$loaded[$instance] = $class;
303 294
 					$logger->info('Library [' . $class . '] --> ' . $libraryFilePath . ' loaded successfully.');
304
-				}
305
-				else{
295
+				} else{
306 296
 					show_error('The file '.$libraryFilePath.' exists but does not contain the class '.$class);
307 297
 				}
308
-			}
309
-			else{
298
+			} else{
310 299
 				show_error('Unable to find library class [' . $class . ']');
311 300
 			}
312 301
 		}
@@ -350,8 +339,7 @@  discard block
 block discarded – undo
350 339
 			if($moduleFunctionPath){
351 340
 				$logger->info('Found helper [' . $function . '] from module [' .$searchModuleName. '], the file path is [' .$moduleFunctionPath. '] we will used it');
352 341
 				$functionFilePath = $moduleFunctionPath;
353
-			}
354
-			else{
342
+			} else{
355 343
 				$logger->info('Cannot find helper [' . $function . '] from modules using the default location');
356 344
 			}
357 345
 			if(! $functionFilePath){
@@ -370,8 +358,7 @@  discard block
 block discarded – undo
370 358
 				require_once $functionFilePath;
371 359
 				static::$loaded['function_' . $function] = $functionFilePath;
372 360
 				$logger->info('Helper [' . $function . '] --> ' . $functionFilePath . ' loaded successfully.');
373
-			}
374
-			else{
361
+			} else{
375 362
 				show_error('Unable to find helper file [' . $file . ']');
376 363
 			}
377 364
 		}
@@ -414,8 +401,7 @@  discard block
 block discarded – undo
414 401
 			if($moduleConfigPath){
415 402
 				$logger->info('Found config [' . $filename . '] from module [' .$searchModuleName. '], the file path is [' .$moduleConfigPath. '] we will used it');
416 403
 				$configFilePath = $moduleConfigPath;
417
-			}
418
-			else{
404
+			} else{
419 405
 				$logger->info('Cannot find config [' . $filename . '] from modules using the default location');
420 406
 			}
421 407
 			$logger->info('The config file path to be loaded is [' . $configFilePath . ']');
@@ -424,8 +410,7 @@  discard block
 block discarded – undo
424 410
 				if(! empty($config) && is_array($config)){
425 411
 					Config::setAll($config);
426 412
 				}
427
-			}
428
-			else{
413
+			} else{
429 414
 				show_error('Unable to find config file ['. $configFilePath . ']');
430 415
 			}
431 416
 			static::$loaded['config_' . $filename] = $configFilePath;
@@ -483,8 +468,7 @@  discard block
 block discarded – undo
483 468
 			if($moduleLanguagePath){
484 469
 				$logger->info('Found language [' . $language . '] from module [' .$searchModuleName. '], the file path is [' .$moduleLanguagePath. '] we will used it');
485 470
 				$languageFilePath = $moduleLanguagePath;
486
-			}
487
-			else{
471
+			} else{
488 472
 				$logger->info('Cannot find language [' . $language . '] from modules using the default location');
489 473
 			}
490 474
 			if(! $languageFilePath){
@@ -511,8 +495,7 @@  discard block
 block discarded – undo
511 495
 				}
512 496
 				static::$loaded['lang_' . $language] = $languageFilePath;
513 497
 				$logger->info('Language [' . $language . '] --> ' . $languageFilePath . ' loaded successfully.');
514
-			}
515
-			else{
498
+			} else{
516 499
 				show_error('Unable to find language file [' . $file . ']');
517 500
 			}
518 501
 		}
Please login to merge, or discard this patch.
core/classes/EventDispatcher.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -59,8 +59,7 @@  discard block
 block discarded – undo
59 59
 			if(! isset($this->listeners[$eventName])){
60 60
 				$this->logger->info('This event does not have the registered event listener before, adding new one');
61 61
 				$this->listeners[$eventName] = array();
62
-			}
63
-			else{
62
+			} else{
64 63
 				$this->logger->info('This event already have the registered listener, add this listener to the list');
65 64
 			}
66 65
 			$this->listeners[$eventName][] = $listener;
@@ -78,12 +77,10 @@  discard block
 block discarded – undo
78 77
 				if(false !== $index = array_search($listener, $this->listeners[$eventName], true)){
79 78
 					$this->logger->info('Found the listener at index [' .$index. '] remove it');
80 79
 					unset($this->listeners[$eventName][$index]);
81
-				}
82
-				else{
80
+				} else{
83 81
 					$this->logger->info('Cannot found this listener in the event listener list');
84 82
 				}
85
-			}
86
-			else{
83
+			} else{
87 84
 				$this->logger->info('This event does not have this listener ignore remove');
88 85
 			}
89 86
 		}
@@ -98,8 +95,7 @@  discard block
 block discarded – undo
98 95
 			if($eventName !== null && isset($this->listeners[$eventName])){
99 96
 				$this->logger->info('The event name is set of exist in the listener just remove all event listener for this event');
100 97
 				unset($this->listeners[$eventName]);
101
-			}
102
-			else{
98
+			} else{
103 99
 				$this->logger->info('The event name is not set or does not exist in the listener, so remove all event listener');
104 100
 				$this->listeners = array();
105 101
 			}
@@ -132,8 +128,7 @@  discard block
 block discarded – undo
132 128
 			if($event->returnBack){
133 129
 				$this->logger->info('This event need return back, return the result for future use');
134 130
 				return $this->dispatchToListerners($event);
135
-			}
136
-			else{
131
+			} else{
137 132
 				$this->logger->info('This event no need return back the result, just dispatch it');
138 133
 				$this->dispatchToListerners($event);
139 134
 			}
@@ -153,8 +148,7 @@  discard block
 block discarded – undo
153 148
 					return $event;
154 149
 				}
155 150
 				return;
156
-			}
157
-			else{
151
+			} else{
158 152
 				$this->logger->info('Found the registered event listener for the event [' .$event->name. '] the list are: ' . stringfy_vars($list));
159 153
 			}
160 154
 			foreach($list as $listener){
@@ -162,12 +156,10 @@  discard block
 block discarded – undo
162 156
 					$returnedEvent = call_user_func_array($listener, array($event));
163 157
 					if($returnedEvent instanceof EventInfo){
164 158
 						$event = $returnedEvent;
165
-					}
166
-					else{
159
+					} else{
167 160
 						show_error('This event [' .$event->name. '] need you return the event object after processing');
168 161
 					}
169
-				}
170
-				else{
162
+				} else{
171 163
 					call_user_func_array($listener, array($event));
172 164
 				}
173 165
 				if($event->stop){
Please login to merge, or discard this patch.
core/classes/Controller.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,8 +115,7 @@
 block discarded – undo
115 115
 		protected function setLoggerFromParamOrCreateNewInstance(Log $logger = null){
116 116
 			if($logger !== null){
117 117
 	          $this->logger = $logger;
118
-	        }
119
-	        else{
118
+	        } else{
120 119
 	            $this->logger =& class_loader('Log', 'classes');
121 120
 				$this->logger->setLogger('MainController');
122 121
 	        }
Please login to merge, or discard this patch.
tests/include/autoloader.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,8 +43,7 @@
 block discarded – undo
43 43
 		if(isset($classesMap[$class])){
44 44
 			if(file_exists($classesMap[$class])){
45 45
 				require_once $classesMap[$class];
46
-			}
47
-			else{
46
+			} else{
48 47
 				echo 'File for class ' . $class . ' not found';
49 48
 			}
50 49
 		}
Please login to merge, or discard this patch.
core/common.php 1 patch
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -226,16 +226,14 @@  discard block
 block discarded – undo
226 226
 							);
227 227
 			if (isset($http_status[$code])){
228 228
 				$text = $http_status[$code];
229
-			}
230
-			else{
229
+			} else{
231 230
 				show_error('No HTTP status text found for your code please check it.');
232 231
 			}
233 232
 		}
234 233
 		
235 234
 		if (strpos(php_sapi_name(), 'cgi') === 0){
236 235
 			header('Status: ' . $code . ' ' . $text, TRUE);
237
-		}
238
-		else{
236
+		} else{
239 237
 			$proto = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';
240 238
 			header($proto . ' ' . $code . ' ' . $text, TRUE, $code);
241 239
 		}
@@ -277,11 +275,9 @@  discard block
 block discarded – undo
277 275
 		*/
278 276
 		if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off'){
279 277
 			return true;
280
-		}
281
-		else if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https'){
278
+		} else if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https'){
282 279
 			return true;
283
-		}
284
-		else if (isset($_SERVER['HTTP_FRONT_END_HTTPS']) && strtolower($_SERVER['HTTP_FRONT_END_HTTPS']) !== 'off'){
280
+		} else if (isset($_SERVER['HTTP_FRONT_END_HTTPS']) && strtolower($_SERVER['HTTP_FRONT_END_HTTPS']) !== 'off'){
285 281
 			return true;
286 282
 		}
287 283
 		return false;
@@ -324,8 +320,7 @@  discard block
 block discarded – undo
324 320
 	function php_exception_handler($ex){
325 321
 		if (str_ireplace(array('off', 'none', 'no', 'false', 'null'), '', ini_get('display_errors'))){
326 322
 			show_error('An exception is occured in file '. $ex->getFile() .' at line ' . $ex->getLine() . ' raison : ' . $ex->getMessage(), 'PHP Exception #' . $ex->getCode());
327
-		}
328
-		else{
323
+		} else{
329 324
 			save_to_log('error', 'An exception is occured in file ' . $ex->getFile() . ' at line ' . $ex->getLine() . ' raison : ' . $ex->getMessage(), 'PHP Exception');
330 325
 		}
331 326
 		return true;
@@ -447,15 +442,13 @@  discard block
 block discarded – undo
447 442
 	function clean_input($str){
448 443
 		if (is_array($str)){
449 444
 			$str = array_map('clean_input', $str);
450
-		}
451
-		else if (is_object($str)){
445
+		} else if (is_object($str)){
452 446
 			$obj = $str;
453 447
 			foreach ($str as $var => $value) {
454 448
 				$obj->$var = clean_input($value);
455 449
 			}
456 450
 			$str = $obj;
457
-		}
458
-		else{
451
+		} else{
459 452
 			$str = htmlspecialchars(strip_tags($str), ENT_QUOTES, 'UTF-8');
460 453
 		}
461 454
 		return $str;
@@ -528,8 +521,7 @@  discard block
 block discarded – undo
528 521
 					session_save_path($sessionSavePath);
529 522
 					$logger->info('Session save path: ' . $sessionSavePath);
530 523
 				}
531
-			}
532
-			else if ($sessionHandler == 'database'){
524
+			} else if ($sessionHandler == 'database'){
533 525
 				//load database session handle library
534 526
 				//Database Session handler Model
535 527
 				require_once CORE_CLASSES_MODEL_PATH . 'DBSessionHandlerModel.php';
@@ -537,8 +529,7 @@  discard block
 block discarded – undo
537 529
 				$DBS =& class_loader('DBSessionHandler', 'classes');
538 530
 				session_set_save_handler($DBS, true);
539 531
 				$logger->info('session save path: ' . get_config('session_save_path'));
540
-			}
541
-			else{
532
+			} else{
542 533
 				show_error('Invalid session handler configuration');
543 534
 			}
544 535
 			$lifetime = get_config('session_cookie_lifetime', 0);
Please login to merge, or discard this patch.
core/classes/model/Model.php 1 patch
Braces   +32 added lines, -64 removed lines patch added patch discarded remove patch
@@ -143,8 +143,7 @@  discard block
 block discarded – undo
143 143
         public function __construct(Database $db = null){
144 144
             if (is_object($db)){
145 145
                 $this->setDatabaseInstance($db);
146
-            }
147
-            else{
146
+            } else{
148 147
                 $obj = & get_instance();
149 148
         		if (isset($obj->database) && is_object($obj->database)){
150 149
                     /**
@@ -260,8 +259,7 @@  discard block
 block discarded – undo
260 259
                 $this->trigger('after_create', $insert_id);
261 260
 				//if the table doesn't have the auto increment field or sequence, the value of 0 will be returned 
262 261
 				return ! $insert_id ? true : $insert_id;
263
-            }
264
-            else
262
+            } else
265 263
             {
266 264
                 return FALSE;
267 265
             }
@@ -298,8 +296,7 @@  discard block
 block discarded – undo
298 296
                 $result = $this->_database->update($data, $escape);
299 297
                 $this->trigger('after_update', array($data, $result));
300 298
                 return $result;
301
-            }
302
-            else
299
+            } else
303 300
             {
304 301
                 return FALSE;
305 302
             }
@@ -322,8 +319,7 @@  discard block
 block discarded – undo
322 319
 				$result = $this->_database->update($data, $escape);
323 320
                 $this->trigger('after_update', array($data, $result));
324 321
                 return $result;
325
-            }
326
-            else
322
+            } else
327 323
             {
328 324
                 return FALSE;
329 325
             }
@@ -340,8 +336,7 @@  discard block
 block discarded – undo
340 336
                 if (is_array($args[1])){
341 337
                     $data = array_pop($args);
342 338
                 }
343
-            }
344
-            else if (count($args) == 3){
339
+            } else if (count($args) == 3){
345 340
                 if (is_array($args[2])){
346 341
                     $data = array_pop($args);
347 342
                 }
@@ -354,8 +349,7 @@  discard block
 block discarded – undo
354 349
 				$result = $this->_database->update($data);
355 350
                 $this->trigger('after_update', array($data, $result));
356 351
                 return $result;
357
-            }
358
-            else
352
+            } else
359 353
             {
360 354
                 return FALSE;
361 355
             }
@@ -385,8 +379,7 @@  discard block
 block discarded – undo
385 379
             {
386 380
                 $this->getQueryBuilder()->from($this->_table);	
387 381
 				$result = $this->_database->update(array( $this->soft_delete_key => TRUE ));
388
-            }
389
-            else
382
+            } else
390 383
             {
391 384
                 $this->getQueryBuilder()->from($this->_table); 
392 385
 				$result = $this->_database->delete();
@@ -409,8 +402,7 @@  discard block
 block discarded – undo
409 402
             {
410 403
                 $this->getQueryBuilder()->from($this->_table);	
411 404
 				$result = $this->_database->update(array( $this->soft_delete_key => TRUE ));
412
-            }
413
-            else
405
+            } else
414 406
             {
415 407
                 $this->getQueryBuilder()->from($this->_table); 
416 408
 				$result = $this->_database->delete();
@@ -431,8 +423,7 @@  discard block
 block discarded – undo
431 423
             {
432 424
                 $this->getQueryBuilder()->from($this->_table);	
433 425
 				$result = $this->_database->update(array( $this->soft_delete_key => TRUE ));
434
-            }
435
-            else
426
+            } else
436 427
             {
437 428
                 $this->getQueryBuilder()->from($this->_table); 
438 429
 				$result = $this->_database->delete();
@@ -494,8 +485,7 @@  discard block
 block discarded – undo
494 485
             if (count($args) == 2)
495 486
             {
496 487
                 list($key, $value) = $args;
497
-            }
498
-            else
488
+            } else
499 489
             {
500 490
                 $key = $this->primary_key;
501 491
                 $value = $args[0];
@@ -647,8 +637,7 @@  discard block
 block discarded – undo
647 637
             if (is_object($row))
648 638
             {
649 639
                 $row->created_at = date('Y-m-d H:i:s');
650
-            }
651
-            else
640
+            } else
652 641
             {
653 642
                 $row['created_at'] = date('Y-m-d H:i:s');
654 643
             }
@@ -660,8 +649,7 @@  discard block
 block discarded – undo
660 649
             if (is_object($row))
661 650
             {
662 651
                 $row->updated_at = date('Y-m-d H:i:s');
663
-            }
664
-            else
652
+            } else
665 653
             {
666 654
                 $row['updated_at'] = date('Y-m-d H:i:s');
667 655
             }
@@ -688,8 +676,7 @@  discard block
 block discarded – undo
688 676
                 if (is_array($row))
689 677
                 {
690 678
                     $row[$column] = unserialize($row[$column]);
691
-                }
692
-                else
679
+                } else
693 680
                 {
694 681
                     $row->$column = unserialize($row->$column);
695 682
                 }
@@ -709,8 +696,7 @@  discard block
 block discarded – undo
709 696
 					if (isset($row->$attr)){
710 697
 						unset($row->$attr);
711 698
 					}
712
-                }
713
-                else
699
+                } else
714 700
                 {
715 701
 					if (isset($row[$attr])){
716 702
 						unset($row[$attr]);
@@ -810,8 +796,7 @@  discard block
 block discarded – undo
810 796
                 {
811 797
                     $this->getQueryBuilder()->orderBy($key, $value);
812 798
                 }
813
-            }
814
-            else
799
+            } else
815 800
             {
816 801
                 $this->getQueryBuilder()->orderBy($criteria, $order);
817 802
             }
@@ -842,8 +827,7 @@  discard block
 block discarded – undo
842 827
                 {
843 828
                     $relationship = $value;
844 829
                     $options = array( 'primary_key' => $value . '_id', 'model' => $value . '_model' );
845
-                }
846
-                else
830
+                } else
847 831
                 {
848 832
                     $relationship = $key;
849 833
                     $options = $value;
@@ -853,15 +837,13 @@  discard block
 block discarded – undo
853 837
                 {
854 838
                     if (is_object($this->loaderInstance)){
855 839
                         $this->loaderInstance->model($options['model'], $relationship . '_model');
856
-                    }
857
-                    else{
840
+                    } else{
858 841
                         Loader::model($options['model'], $relationship . '_model');    
859 842
                     }
860 843
                     if (is_object($row))
861 844
                     {
862 845
                         $row->{$relationship} = $this->{$relationship . '_model'}->get($row->{$options['primary_key']});
863
-                    }
864
-                    else
846
+                    } else
865 847
                     {
866 848
                         $row[$relationship] = $this->{$relationship . '_model'}->get($row[$options['primary_key']]);
867 849
                     }
@@ -881,8 +863,7 @@  discard block
 block discarded – undo
881 863
                 {
882 864
                     $relationship = $value;
883 865
                     $options = array( 'primary_key' => $this->_table . '_id', 'model' => $value . '_model' );
884
-                }
885
-                else
866
+                } else
886 867
                 {
887 868
                     $relationship = $key;
888 869
                     $options = $value;
@@ -892,15 +873,13 @@  discard block
 block discarded – undo
892 873
                 {
893 874
                     if (is_object($this->loaderInstance)){
894 875
                         $this->loaderInstance->model($options['model'], $relationship . '_model');
895
-                    }
896
-                    else{
876
+                    } else{
897 877
                         Loader::model($options['model'], $relationship . '_model');    
898 878
                     }
899 879
                     if (is_object($row))
900 880
                     {
901 881
                         $row->{$relationship} = $this->{$relationship . '_model'}->get_many_by($options['primary_key'], $row->{$this->primary_key});
902
-                    }
903
-                    else
882
+                    } else
904 883
                     {
905 884
                         $row[$relationship] = $this->{$relationship . '_model'}->get_many_by($options['primary_key'], $row[$this->primary_key]);
906 885
                     }
@@ -946,8 +925,7 @@  discard block
 block discarded – undo
946 925
                 $fv = null;
947 926
                 if (is_object($this->formValidationInstance)){
948 927
                     $fv = $this->formValidationInstance;
949
-                }
950
-                else{
928
+                } else{
951 929
                     Loader::library('FormValidation');
952 930
                     $fv = $this->formvalidation;
953 931
                     $this->setFormValidation($fv);
@@ -959,13 +937,11 @@  discard block
 block discarded – undo
959 937
                 if ($fv->run())
960 938
                 {
961 939
                     return $data;
962
-                }
963
-                else
940
+                } else
964 941
                 {
965 942
                     return FALSE;
966 943
                 }
967
-            }
968
-            else
944
+            } else
969 945
             {
970 946
                 return $data;
971 947
             }
@@ -982,14 +958,12 @@  discard block
 block discarded – undo
982 958
 				if (is_array($filter))
983 959
 				{
984 960
 					$this->getQueryBuilder()->in($field, $filter);
985
-				}
986
-				else
961
+				} else
987 962
 				{
988 963
 					if (is_int($field))
989 964
 					{
990 965
 						$this->getQueryBuilder()->where($filter);
991
-					}
992
-					else
966
+					} else
993 967
 					{
994 968
 						$this->getQueryBuilder()->where($field, $filter);
995 969
 					}
@@ -1006,33 +980,27 @@  discard block
 block discarded – undo
1006 980
             if (count($params) == 1 && is_array($params[0]))
1007 981
             {
1008 982
                 $this->_set_where_array($params[0]);
1009
-            }
1010
-            else if (count($params) == 1)
983
+            } else if (count($params) == 1)
1011 984
             {
1012 985
                 $this->getQueryBuilder()->where($params[0]);
1013
-            }
1014
-        	else if (count($params) == 2)
986
+            } else if (count($params) == 2)
1015 987
     		{
1016 988
                 if (is_array($params[1]))
1017 989
                 {
1018 990
                     $this->getQueryBuilder()->in($params[0], $params[1]);
1019
-                }
1020
-                else
991
+                } else
1021 992
                 {
1022 993
                     $this->getQueryBuilder()->where($params[0], $params[1]);
1023 994
                 }
1024
-    		}
1025
-    		else if (count($params) == 3)
995
+    		} else if (count($params) == 3)
1026 996
     		{
1027 997
     			$this->getQueryBuilder()->where($params[0], $params[1], $params[2]);
1028
-    		}
1029
-            else
998
+    		} else
1030 999
             {
1031 1000
                 if (is_array($params[1]))
1032 1001
                 {
1033 1002
                     $this->getQueryBuilder()->in($params[0], $params[1]);
1034
-                }
1035
-                else
1003
+                } else
1036 1004
                 {
1037 1005
                     $this->getQueryBuilder()->where($params[0], $params[1]);
1038 1006
                 }
Please login to merge, or discard this patch.