Test Failed
Push — 1.0.0-dev ( 92a7f9...7e13dc )
by nguereza
04:45
created
core/classes/Module.php 1 patch
Braces   +11 added lines, -22 removed lines patch added patch discarded remove patch
@@ -60,8 +60,7 @@  discard block
 block discarded – undo
60 60
 			while(($module = readdir($moduleDir)) !== false){
61 61
 				if($module != '.' && $module != '..'  && preg_match('/^([a-z0-9-_]+)$/i', $module) && is_dir(MODULE_PATH . $module)){
62 62
 					static::$list[] = $module;
63
-				}
64
-				else{
63
+				} else{
65 64
 					$logger->info('Skipping [' .$module. '], may be this is not a directory or does not exists or is invalid name');
66 65
 				}
67 66
 			}
@@ -70,8 +69,7 @@  discard block
 block discarded – undo
70 69
 			
71 70
 			if(static::hasModule()){
72 71
 				$logger->info('The application contains the module below [' . implode(', ', static::getModuleList()) . ']');
73
-			}
74
-			else{
72
+			} else{
75 73
 				$logger->info('The application contains no module skipping');
76 74
 			}
77 75
 		}
@@ -118,8 +116,7 @@  discard block
 block discarded – undo
118 116
 							$autoloads['languages'] = array_merge($autoloads['languages'], $autoload['languages']);
119 117
 						}
120 118
 						unset($autoload);
121
-					}
122
-					else{
119
+					} else{
123 120
 						show_error('No autoload configuration found in autoload.php for module [' .$module. ']');
124 121
 					}
125 122
 				}
@@ -145,8 +142,7 @@  discard block
 block discarded – undo
145 142
 					if(! empty($route) && is_array($route)){
146 143
 						$routes = array_merge($routes, $route);
147 144
 						unset($route);
148
-					}
149
-					else{
145
+					} else{
150 146
 						show_error('No routing configuration found in [' .$file. '] for module [' . $module . ']');
151 147
 					}
152 148
 				}
@@ -175,8 +171,7 @@  discard block
 block discarded – undo
175 171
 			if(file_exists($filePath)){
176 172
 				$logger->info('Found controller [' . $class . '] in module [' .$module. '], the file path is [' .$filePath. ']');
177 173
 				return $filePath;
178
-			}
179
-			else{
174
+			} else{
180 175
 				$logger->info('Controller [' . $class . '] does not exist in the module [' .$module. ']');
181 176
 				return false;
182 177
 			}
@@ -202,8 +197,7 @@  discard block
 block discarded – undo
202 197
 			if(file_exists($filePath)){
203 198
 				$logger->info('Found model [' . $class . '] in module [' .$module. '], the file path is [' .$filePath. ']');
204 199
 				return $filePath;
205
-			}
206
-			else{
200
+			} else{
207 201
 				$logger->info('Model [' . $class . '] does not exist in the module [' .$module. ']');
208 202
 				return false;
209 203
 			}
@@ -228,8 +222,7 @@  discard block
 block discarded – undo
228 222
 			if(file_exists($filePath)){
229 223
 				$logger->info('Found configuration [' . $configuration . '] in module [' .$module. '], the file path is [' .$filePath. ']');
230 224
 				return $filePath;
231
-			}
232
-			else{
225
+			} else{
233 226
 				$logger->info('Configuration [' . $configuration . '] does not exist in the module [' .$module. ']');
234 227
 				return false;
235 228
 			}
@@ -255,8 +248,7 @@  discard block
 block discarded – undo
255 248
 			if(file_exists($filePath)){
256 249
 				$logger->info('Found helper [' . $helper . '] in module [' .$module. '], the file path is [' .$filePath. ']');
257 250
 				return $filePath;
258
-			}
259
-			else{
251
+			} else{
260 252
 				$logger->info('Helper [' . $helper . '] does not exist in the module [' .$module. ']');
261 253
 				return false;
262 254
 			}
@@ -282,8 +274,7 @@  discard block
 block discarded – undo
282 274
 			if(file_exists($filePath)){
283 275
 				$logger->info('Found library [' . $class . '] in module [' .$module. '], the file path is [' .$filePath. ']');
284 276
 				return $filePath;
285
-			}
286
-			else{
277
+			} else{
287 278
 				$logger->info('Library [' . $class . '] does not exist in the module [' .$module. ']');
288 279
 				return false;
289 280
 			}
@@ -311,8 +302,7 @@  discard block
 block discarded – undo
311 302
 			if(file_exists($filePath)){
312 303
 				$logger->info('Found view [' . $view . '] in module [' .$module. '], the file path is [' .$filePath. ']');
313 304
 				return $filePath;
314
-			}
315
-			else{
305
+			} else{
316 306
 				$logger->info('View [' . $view . '] does not exist in the module [' .$module. ']');
317 307
 				return false;
318 308
 			}
@@ -339,8 +329,7 @@  discard block
 block discarded – undo
339 329
 			if(file_exists($filePath)){
340 330
 				$logger->info('Found language [' . $language . '] in module [' .$module. '], the file path is [' .$filePath. ']');
341 331
 				return $filePath;
342
-			}
343
-			else{
332
+			} else{
344 333
 				$logger->info('Language [' . $language . '] does not exist in the module [' .$module. ']');
345 334
 				return false;
346 335
 			}
Please login to merge, or discard this patch.
core/classes/Log.php 1 patch
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -137,8 +137,7 @@  discard block
 block discarded – undo
137 137
 						if(! in_array(strtolower($this->logger), $configLoggerName)){
138 138
 							return;
139 139
 						}
140
-					}
141
-					else if(strtolower($this->logger) !== strtolower($configLoggerName)){
140
+					} else if(strtolower($this->logger) !== strtolower($configLoggerName)){
142 141
 						return; 
143 142
 					}
144 143
 				}
@@ -218,20 +217,15 @@  discard block
 block discarded – undo
218 217
 			//the default value is NONE, so means no need test for NONE
219 218
 			if($level == 'fatal'){
220 219
 				$value = self::FATAL;
221
-			}
222
-			else if($level == 'error'){
220
+			} else if($level == 'error'){
223 221
 				$value = self::ERROR;
224
-			}
225
-			else if($level == 'warning' || $level == 'warn'){
222
+			} else if($level == 'warning' || $level == 'warn'){
226 223
 				$value = self::WARNING;
227
-			}
228
-			else if($level == 'info'){
224
+			} else if($level == 'info'){
229 225
 				$value = self::INFO;
230
-			}
231
-			else if($level == 'debug'){
226
+			} else if($level == 'debug'){
232 227
 				$value = self::DEBUG;
233
-			}
234
-			else if($level == 'all'){
228
+			} else if($level == 'all'){
235 229
 				$value = self::ALL;
236 230
 			}
237 231
 			return $value;
@@ -248,17 +242,13 @@  discard block
 block discarded – undo
248 242
 			//the default value is NONE, so means no need test for NONE
249 243
 			if($level == self::FATAL){
250 244
 				$value = 'FATAL';
251
-			}
252
-			else if($level == self::ERROR){
245
+			} else if($level == self::ERROR){
253 246
 				$value = 'ERROR';
254
-			}
255
-			else if($level == self::WARNING){
247
+			} else if($level == self::WARNING){
256 248
 				$value = 'WARNING';
257
-			}
258
-			else if($level == self::INFO){
249
+			} else if($level == self::INFO){
259 250
 				$value = 'INFO';
260
-			}
261
-			else if($level == self::DEBUG){
251
+			} else if($level == self::DEBUG){
262 252
 				$value = 'DEBUG';
263 253
 			}
264 254
 			//no need for ALL
Please login to merge, or discard this patch.
core/libraries/PDF.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,8 +69,7 @@
 block discarded – undo
69 69
 			$this->dompdf->render();
70 70
 			if($stream){
71 71
 				$this->dompdf->stream($filename);
72
-			}
73
-			else{
72
+			} else{
74 73
 				return $this->dompdf->output();
75 74
 			}
76 75
 		}
Please login to merge, or discard this patch.
core/libraries/Email.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -150,8 +150,7 @@
 block discarded – undo
150 150
 			foreach ($emails as $name => $email) {
151 151
 				if(is_numeric($name)){
152 152
 					$this->setTo($email);
153
-				}
154
-				else{
153
+				} else{
155 154
 					$this->setTo($email, $name);
156 155
 				}
157 156
 			}
Please login to merge, or discard this patch.
core/libraries/Cookie.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -93,8 +93,7 @@
 block discarded – undo
93 93
 				$logger->info('Delete cookie item ['.$item.']');
94 94
 				unset($_COOKIE[$item]);
95 95
 				return true;
96
-			}
97
-			else{
96
+			} else{
98 97
 				$logger->warning('Cookie item ['.$item.'] to be deleted does not exists');
99 98
 				return false;
100 99
 			}
Please login to merge, or discard this patch.
core/libraries/Upload.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -487,8 +487,7 @@  discard block
 block discarded – undo
487 487
                             }
488 488
                             chdir($destination_directory);
489 489
                         }
490
-                    }
491
-                    else{
490
+                    } else{
492 491
                         $this->logger->warning('Can not create the upload directory [' .$destination_directory. ']');
493 492
                     }
494 493
                 }
@@ -640,8 +639,7 @@  discard block
 block discarded – undo
640 639
                     // set original filename if not have a new name
641 640
                     if (empty($this->filename)) {
642 641
                         $this->filename = $this->file_array[$this->input]['name'];
643
-                    }
644
-                    else{
642
+                    } else{
645 643
                         // Replace %s for extension in filename
646 644
                         // Before: /[\w\d]*(.[\d\w]+)$/i
647 645
                         // After: /^[\s[:alnum:]\-\_\.]*\.([\d\w]+)$/iu
Please login to merge, or discard this patch.
core/libraries/FormValidation.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -223,8 +223,7 @@  discard block
 block discarded – undo
223 223
                     if(! Security::validateCSRF()){
224 224
                         show_error('Invalide data, Cross Site Request Forgery do his job, the data to validate is corrupted.');
225 225
                     }
226
-                }
227
-                else{
226
+                } else{
228 227
                     $this->logger->info('CSRF is not enabled in configuration or not set manully, no need to check it');
229 228
                 }
230 229
             }
@@ -234,8 +233,7 @@  discard block
 block discarded – undo
234 233
             foreach ($this->getData() as $inputName => $inputVal) {
235 234
     			if(is_array($this->data[$inputName])){
236 235
     				$this->data[$inputName] = array_map('trim', $this->data[$inputName]);
237
-    			}
238
-    			else{
236
+    			} else{
239 237
     				$this->data[$inputName] = trim($this->data[$inputName]);
240 238
     			}
241 239
 
@@ -604,8 +602,7 @@  discard block
 block discarded – undo
604 602
                 if ($inputVal == '' && $callbackReturn == true) {
605 603
                     $this->_setError($inputName, $ruleName, $this->_getLabel($inputName));
606 604
                 }
607
-            } 
608
-			else if($inputVal == '') {
605
+            } else if($inputVal == '') {
609 606
 				$this->_setError($inputName, $ruleName, $this->_getLabel($inputName));
610 607
             }
611 608
         }
@@ -664,8 +661,7 @@  discard block
 block discarded – undo
664 661
                         $this->_setError($inputName, $ruleName . ',post:key', array($this->_getLabel($inputName), $this->_getLabel(str_replace('post:', '', $doNotEqual))));
665 662
                         continue;
666 663
                     }
667
-                } 
668
-				else{
664
+                } else{
669 665
                     if ($inputVal == $doNotEqual) {
670 666
                         $this->_setError($inputName, $ruleName . ',string', array($this->_getLabel($inputName), $doNotEqual));
671 667
                         continue;
Please login to merge, or discard this patch.
core/libraries/Html.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -222,8 +222,7 @@
 block discarded – undo
222 222
 				}
223 223
 				$str .= '</tr>';
224 224
 				$str .= '</thead>';
225
-			}
226
-			else{
225
+			} else{
227 226
 				//no need check for footer
228 227
 				$use_footer = false;
229 228
 			}
Please login to merge, or discard this patch.
core/libraries/Pagination.php 1 patch
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@  discard block
 block discarded – undo
41 41
                 require_once CONFIG_PATH . 'config_pagination.php';
42 42
                 if(empty($config) || ! is_array($config)){
43 43
                     show_error('No configuration found in ' . CONFIG_PATH . 'config_pagination.php');
44
-                }
45
-				else{
44
+                } else{
46 45
 					if(! empty($overwriteConfig)){
47 46
 						$config = array_merge($config, $overwriteConfig);
48 47
 					}
@@ -50,8 +49,7 @@  discard block
 block discarded – undo
50 49
 					Config::setAll($config);
51 50
 					unset($config);
52 51
 				}
53
-            }
54
-            else{
52
+            } else{
55 53
                 show_error('Unable to find the pagination configuration file');
56 54
             }
57 55
         }
@@ -83,18 +81,15 @@  discard block
 block discarded – undo
83 81
             $currentUrl = Url::current();
84 82
             if($queryString == ''){
85 83
                 $query = '?' . $pageQueryName . '=';
86
-            }
87
-            else{
84
+            } else{
88 85
                 $tab = explode($pageQueryName . '=', $queryString);
89 86
                 $nb = count($tab);
90 87
                 if($nb == 1){
91 88
                     $query = '?' . $queryString . '&' . $pageQueryName . '=';
92
-                }
93
-                else{
89
+                } else{
94 90
                     if($tab[0] == ''){
95 91
                         $query = '?' . $pageQueryName . '=';
96
-                    }
97
-                    else{
92
+                    } else{
98 93
                         $query = '?' . $tab[0] . '' . $pageQueryName . '=';
99 94
                     }
100 95
                 }
@@ -113,20 +108,17 @@  discard block
 block discarded – undo
113 108
             if($numberOfLink % 2 == 0){
114 109
                 $start = $currentPageNumber - ($numberOfLink / 2) + 1;
115 110
                 $end = $currentPageNumber + ($numberOfLink / 2);
116
-            }
117
-            else{
111
+            } else{
118 112
                 $start = $currentPageNumber - floor($numberOfLink / 2);
119 113
                 $end = $currentPageNumber + floor($numberOfLink / 2);
120 114
             }
121 115
             if($start <= 1){
122 116
                 $begin = 1;
123 117
                 $end = $numberOfLink;
124
-            }
125
-            else if($start > 1 && $end < $numberOfPage){
118
+            } else if($start > 1 && $end < $numberOfPage){
126 119
                 $begin = $start;
127 120
                 $end = $end;
128
-            }
129
-            else{
121
+            } else{
130 122
                 $begin = ($numberOfPage - $numberOfLink) + 1;
131 123
                 $end = $numberOfPage;
132 124
             }
@@ -138,32 +130,27 @@  discard block
 block discarded – undo
138 130
                 for($i = $begin; $i <= $end; $i++){
139 131
                     if($i == $currentPageNumber){
140 132
                         $navbar .= $this->config['active_link_open'] . $currentPageNumber . $this->config['active_link_close'];
141
-                    }
142
-                    else{
133
+                    } else{
143 134
                         $navbar .= $this->config['digit_open'] . '<a href="' . $query . $i . '" ' . attributes_to_string($this->config['attributes']) . '>' . $i . '</a>' . $this->config['digit_close'];
144 135
                     }
145 136
                 }
146 137
                 $navbar .= $this->config['next_open'] . '<a href="' . $query . ($currentPageNumber + 1) . '">' . $this->config['next_text'] . '</a>' . $this->config['next_close'];
147
-            }
148
-            else if($currentPageNumber > 1 && $currentPageNumber < $numberOfPage){
138
+            } else if($currentPageNumber > 1 && $currentPageNumber < $numberOfPage){
149 139
                 $navbar .= $this->config['previous_open'] . '<a href="' . $query . ($currentPageNumber - 1) . '">' . $this->config['previous_text'] . '</a>' . $this->config['previous_close'];
150 140
                 for($i = $begin; $i <= $end; $i++){
151 141
                     if($i == $currentPageNumber){
152 142
                         $navbar .= $this->config['active_link_open'] . $currentPageNumber . $this->config['active_link_close'];
153
-                    }
154
-                    else{
143
+                    } else{
155 144
                         $navbar .= $this->config['digit_open'] . '<a href="' . $query . $i . '"' . attributes_to_string($this->config['attributes']) . '>' . $i .'</a>' . $this->config['digit_close'];
156 145
                     }
157 146
                 }
158 147
                 $navbar .= $this->config['next_open']."<a href='$query".($currentPageNumber + 1)."'>".$this->config['next_text']."</a>".$this->config['next_close'];
159
-            }
160
-            else if($currentPageNumber == $numberOfPage){
148
+            } else if($currentPageNumber == $numberOfPage){
161 149
                 $navbar .= $this->config['previous_open'] . '<a href="' . $query . ($currentPageNumber - 1) . '">' . $this->config['previous_text'] . '</a>' . $this->config['previous_close'];
162 150
                 for($i = $begin; $i <= $end; $i++){
163 151
                     if($i == $currentPageNumber){
164 152
                         $navbar .= $this->config['active_link_open'] . $currentPageNumber . $this->config['active_link_close'];
165
-                    }
166
-                    else{
153
+                    } else{
167 154
                         $navbar .= $this->config['digit_open'] . '<a href="' . $query . $i . '"' . attributes_to_string($this->config['attributes']) . '>' . $i . '</a>' . $this->config['digit_close'];
168 155
                     }
169 156
                 }
Please login to merge, or discard this patch.