Passed
Branch 1.0.0-dev (958860)
by nguereza
06:24
created
core/classes/DatabaseQueryBuilder.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -225,8 +225,7 @@  discard block
 block discarded – undo
225 225
       }
226 226
       if (empty($this->join)){
227 227
         $this->join = ' ' . $type . 'JOIN' . ' ' . $table . ' ON ' . $on;
228
-      }
229
-      else{
228
+      } else{
230 229
         $this->join = $this->join . ' ' . $type . 'JOIN' . ' ' . $table . ' ON ' . $on;
231 230
       }
232 231
       return $this;
@@ -334,8 +333,7 @@  discard block
 block discarded – undo
334 333
       $whereStr = '';
335 334
       if (is_array($where)){
336 335
         $whereStr = $this->getWhereStrIfIsArray($where, $type, $andOr, $escape);
337
-      }
338
-      else{
336
+      } else{
339 337
         if (is_array($op)){
340 338
           $whereStr = $this->getWhereStrIfOperatorIsArray($where, $op, $type, $escape);
341 339
         } else {
@@ -585,8 +583,7 @@  discard block
 block discarded – undo
585 583
       }
586 584
       if (! is_null($limitEnd)){
587 585
         $this->limit = $limit . ', ' . $limitEnd;
588
-      }
589
-      else{
586
+      } else{
590 587
         $this->limit = $limit;
591 588
       }
592 589
       return $this;
@@ -601,8 +598,7 @@  discard block
 block discarded – undo
601 598
     public function orderBy($orderBy, $orderDir = ' ASC'){
602 599
       if (stristr($orderBy, ' ') || $orderBy == 'rand()'){
603 600
         $this->orderBy = empty($this->orderBy) ? $orderBy : $this->orderBy . ', ' . $orderBy;
604
-      }
605
-      else{
601
+      } else{
606 602
         $this->orderBy = empty($this->orderBy) 
607 603
 						? ($orderBy . ' ' . strtoupper($orderDir)) 
608 604
 						: $this->orderBy . ', ' . $orderBy . ' ' . strtoupper($orderDir);
@@ -618,8 +614,7 @@  discard block
 block discarded – undo
618 614
     public function groupBy($field){
619 615
       if (is_array($field)){
620 616
         $this->groupBy = implode(', ', $field);
621
-      }
622
-      else{
617
+      } else{
623 618
         $this->groupBy = $field;
624 619
       }
625 620
       return $this;
@@ -636,14 +631,12 @@  discard block
 block discarded – undo
636 631
     public function having($field, $op = null, $val = null, $escape = true){
637 632
       if (is_array($op)){
638 633
         $this->having = $this->getHavingStrIfOperatorIsArray($field, $op, $escape);
639
-      }
640
-      else if (! in_array($op, $this->operatorList)){
634
+      } else if (! in_array($op, $this->operatorList)){
641 635
         if (is_null($op)){
642 636
           $op = '';
643 637
         }
644 638
         $this->having = $field . ' > ' . ($this->escape($op, $escape));
645
-      }
646
-      else{
639
+      } else{
647 640
         if (is_null($val)){
648 641
           $val = '';
649 642
         }
Please login to merge, or discard this patch.
core/classes/Module.php 1 patch
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -61,8 +61,7 @@  discard block
 block discarded – undo
61 61
 				while(($module = readdir($moduleDir)) !== false){
62 62
 					if(preg_match('/^([a-z0-9-_]+)$/i', $module) && is_dir(MODULE_PATH . $module)){
63 63
 						self::$list[] = $module;
64
-					}
65
-					else{
64
+					} else{
66 65
 						$logger->info('Skipping [' .$module. '], may be this is not a directory or does not exists or is invalid name');
67 66
 					}
68 67
 				}
@@ -72,8 +71,7 @@  discard block
 block discarded – undo
72 71
 			
73 72
 			if(self::hasModule()){
74 73
 				$logger->info('The application contains the module below [' . implode(', ', self::getModuleList()) . ']');
75
-			}
76
-			else{
74
+			} else{
77 75
 				$logger->info('The application contains no module skipping');
78 76
 			}
79 77
 		}
@@ -127,8 +125,7 @@  discard block
 block discarded – undo
127 125
 					if(! empty($route) && is_array($route)){
128 126
 						$routes = array_merge($routes, $route);
129 127
 						unset($route);
130
-					}
131
-					else{
128
+					} else{
132 129
 						show_error('No routing configuration found in [' .$file. '] for module [' . $module . ']');
133 130
 					}
134 131
 				}
@@ -157,8 +154,7 @@  discard block
 block discarded – undo
157 154
 			if(file_exists($filePath)){
158 155
 				$logger->info('Found controller [' . $class . '] in module [' .$module. '], the file path is [' .$filePath. ']');
159 156
 				return $filePath;
160
-			}
161
-			else{
157
+			} else{
162 158
 				$logger->info('Controller [' . $class . '] does not exist in the module [' .$module. ']');
163 159
 				return false;
164 160
 			}
@@ -184,8 +180,7 @@  discard block
 block discarded – undo
184 180
 			if(file_exists($filePath)){
185 181
 				$logger->info('Found model [' . $class . '] in module [' .$module. '], the file path is [' .$filePath. ']');
186 182
 				return $filePath;
187
-			}
188
-			else{
183
+			} else{
189 184
 				$logger->info('Model [' . $class . '] does not exist in the module [' .$module. ']');
190 185
 				return false;
191 186
 			}
@@ -210,8 +205,7 @@  discard block
 block discarded – undo
210 205
 			if(file_exists($filePath)){
211 206
 				$logger->info('Found configuration [' . $configuration . '] in module [' .$module. '], the file path is [' .$filePath. ']');
212 207
 				return $filePath;
213
-			}
214
-			else{
208
+			} else{
215 209
 				$logger->info('Configuration [' . $configuration . '] does not exist in the module [' .$module. ']');
216 210
 				return false;
217 211
 			}
@@ -237,8 +231,7 @@  discard block
 block discarded – undo
237 231
 			if(file_exists($filePath)){
238 232
 				$logger->info('Found helper [' . $helper . '] in module [' .$module. '], the file path is [' .$filePath. ']');
239 233
 				return $filePath;
240
-			}
241
-			else{
234
+			} else{
242 235
 				$logger->info('Helper [' . $helper . '] does not exist in the module [' .$module. ']');
243 236
 				return false;
244 237
 			}
@@ -264,8 +257,7 @@  discard block
 block discarded – undo
264 257
 			if(file_exists($filePath)){
265 258
 				$logger->info('Found library [' . $class . '] in module [' .$module. '], the file path is [' .$filePath. ']');
266 259
 				return $filePath;
267
-			}
268
-			else{
260
+			} else{
269 261
 				$logger->info('Library [' . $class . '] does not exist in the module [' .$module. ']');
270 262
 				return false;
271 263
 			}
@@ -293,8 +285,7 @@  discard block
 block discarded – undo
293 285
 			if(file_exists($filePath)){
294 286
 				$logger->info('Found view [' . $view . '] in module [' .$module. '], the file path is [' .$filePath. ']');
295 287
 				return $filePath;
296
-			}
297
-			else{
288
+			} else{
298 289
 				$logger->info('View [' . $view . '] does not exist in the module [' .$module. ']');
299 290
 				return false;
300 291
 			}
@@ -321,8 +312,7 @@  discard block
 block discarded – undo
321 312
 			if(file_exists($filePath)){
322 313
 				$logger->info('Found language [' . $language . '] in module [' .$module. '], the file path is [' .$filePath. ']');
323 314
 				return $filePath;
324
-			}
325
-			else{
315
+			} else{
326 316
 				$logger->info('Language [' . $language . '] does not exist in the module [' .$module. ']');
327 317
 				return false;
328 318
 			}
Please login to merge, or discard this patch.
core/classes/Response.php 1 patch
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -152,8 +152,7 @@  discard block
 block discarded – undo
152 152
 			if(! headers_sent()){
153 153
 				header('Location: '.$url);
154 154
 				exit;
155
-			}
156
-			else{
155
+			} else{
157 156
 				echo '<script>
158 157
 						location.href = "'.$url.'";
159 158
 					</script>';
@@ -202,12 +201,10 @@  discard block
 block discarded – undo
202 201
 					if($moduleViewPath){
203 202
 						$path = $moduleViewPath;
204 203
 						$logger->info('Found view [' . $view . '] in module [' .$mod. '], the file path is [' .$moduleViewPath. '] we will used it');
205
-					}
206
-					else{
204
+					} else{
207 205
 						$logger->info('Cannot find view [' . $view . '] in module [' .$mod. '] using the default location');
208 206
 					}
209
-				}
210
-				else{
207
+				} else{
211 208
 					$logger->info('The current request does not use module using the default location.');
212 209
 				}
213 210
 			}
@@ -326,8 +323,7 @@  discard block
 block discarded – undo
326 323
 					$logger->info('The cache page content is not yet expire for the URL [' . $url . '] send 304 header to browser');
327 324
 					self::sendHeaders(304);
328 325
 					return;
329
-				}
330
-				else{
326
+				} else{
331 327
 					$logger->info('The cache page content is expired or the browser don\'t send the HTTP_IF_MODIFIED_SINCE header for the URL [' . $url . '] send cache headers to tell the browser');
332 328
 					self::sendHeaders(200);
333 329
 					//get the cache content
@@ -347,15 +343,13 @@  discard block
 block discarded – undo
347 343
 						//compress the output if is available
348 344
 						if (self::$_canCompressOutput){
349 345
 							ob_start('ob_gzhandler');
350
-						}
351
-						else{
346
+						} else{
352 347
 							ob_start();
353 348
 						}
354 349
 						echo $content;
355 350
 						ob_end_flush();
356 351
 						return;
357
-					}
358
-					else{
352
+					} else{
359 353
 						$logger->info('The page cache content for the URL [' . $url . '] is not valid may be already expired');
360 354
 						$cache->delete($pageCacheKey);
361 355
 					}
@@ -396,16 +390,14 @@  discard block
 block discarded – undo
396 390
 				//compress the output if is available
397 391
 				if (self::$_canCompressOutput){
398 392
 					ob_start('ob_gzhandler');
399
-				}
400
-				else{
393
+				} else{
401 394
 					ob_start();
402 395
 				}
403 396
 				require_once $path;
404 397
 				$output = ob_get_clean();
405 398
 				self::sendHeaders(404);
406 399
 				echo $output;
407
-			}
408
-			else{
400
+			} else{
409 401
 				show_error('The 404 view [' .$path. '] does not exist');
410 402
 			}
411 403
 		}
@@ -420,8 +412,7 @@  discard block
 block discarded – undo
420 412
 				//compress the output if exists
421 413
 				if (self::$_canCompressOutput){
422 414
 					ob_start('ob_gzhandler');
423
-				}
424
-				else{
415
+				} else{
425 416
 					ob_start();
426 417
 				}
427 418
 				extract($data);
@@ -429,8 +420,7 @@  discard block
 block discarded – undo
429 420
 				$output = ob_get_clean();
430 421
 				self::sendHeaders(503);
431 422
 				echo $output;
432
-			}
433
-			else{
423
+			} else{
434 424
 				//can't use show_error() at this time because some dependencies not yet loaded and to prevent loop
435 425
 				set_http_status_header(503);
436 426
 				echo 'The error view [' . $path . '] does not exist';
Please login to merge, or discard this patch.