Passed
Push — 1.0.0-dev ( 8edc19...2b6704 )
by nguereza
03:32
created
core/libraries/Pagination.php 1 patch
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -48,16 +48,14 @@  discard block
 block discarded – undo
48 48
                 require_once CONFIG_PATH . 'config_pagination.php';
49 49
                 if (empty($config) || ! is_array($config)){
50 50
                     show_error('No configuration found in ' . CONFIG_PATH . 'config_pagination.php');
51
-                }
52
-				else{
51
+                } else{
53 52
 					$config = array_merge($config, $overwriteConfig);
54 53
 					$this->config = $config;
55 54
                     //put it gobally
56 55
 					Config::setAll($config);
57 56
 					unset($config);
58 57
 				}
59
-            }
60
-            else{
58
+            } else{
61 59
                 show_error('Unable to find the pagination configuration file');
62 60
             }
63 61
         }
@@ -115,18 +113,15 @@  discard block
 block discarded – undo
115 113
             $query = '';
116 114
              if ($queryString == ''){
117 115
                 $query = '?' . $pageQueryName . '=';
118
-            }
119
-            else{
116
+            } else{
120 117
                 $tab = explode($pageQueryName . '=', $queryString);
121 118
                 $nb = count($tab);
122 119
                 if ($nb == 1){
123 120
                     $query = '?' . $queryString . '&' . $pageQueryName . '=';
124
-                }
125
-                else{
121
+                } else{
126 122
                     if ($tab[0] == ''){
127 123
                         $query = '?' . $pageQueryName . '=';
128
-                    }
129
-                    else{
124
+                    } else{
130 125
                         $query = '?' . $tab[0] . '' . $pageQueryName . '=';
131 126
                     }
132 127
                 }
@@ -180,11 +175,9 @@  discard block
 block discarded – undo
180 175
             $navbar = null;
181 176
             if ($currentPageNumber == 1){
182 177
                 $navbar .= $this->buildPaginationLinkForFirstPage($begin, $end, $currentPageNumber);
183
-            }
184
-            else if ($currentPageNumber > 1 && $currentPageNumber < $numberOfPage){
178
+            } else if ($currentPageNumber > 1 && $currentPageNumber < $numberOfPage){
185 179
                 $navbar .= $this->buildPaginationLinkForMiddlePage($begin, $end, $currentPageNumber);
186
-            }
187
-            else if ($currentPageNumber == $numberOfPage){
180
+            } else if ($currentPageNumber == $numberOfPage){
188 181
                $navbar .= $this->buildPaginationLinkForLastPage($begin, $end, $currentPageNumber);
189 182
             }
190 183
             $navbar = $this->config['pagination_open'] . $navbar . $this->config['pagination_close'];
@@ -205,20 +198,17 @@  discard block
 block discarded – undo
205 198
             if ($numberOfLink % 2 == 0){
206 199
                 $start = $currentPageNumber - ($numberOfLink / 2) + 1;
207 200
                 $end   = $currentPageNumber + ($numberOfLink / 2);
208
-            }
209
-            else{
201
+            } else{
210 202
                 $start = $currentPageNumber - floor($numberOfLink / 2);
211 203
                 $end   = $currentPageNumber + floor($numberOfLink / 2);
212 204
             }
213 205
             if ($start <= 1){
214 206
                 $begin = 1;
215 207
                 $end   = $numberOfLink;
216
-            }
217
-            else if ($start > 1 && $end < $numberOfPage){
208
+            } else if ($start > 1 && $end < $numberOfPage){
218 209
                 $begin = $start;
219 210
                 $end = $end;
220
-            }
221
-            else{
211
+            } else{
222 212
                 $begin = ($numberOfPage - $numberOfLink) + 1;
223 213
                 $end   = $numberOfPage;
224 214
             }
@@ -245,8 +235,7 @@  discard block
 block discarded – undo
245 235
             for($i = $begin; $i <= $end; $i++){
246 236
                 if ($i == $currentPageNumber){
247 237
                     $navbar .= $this->config['active_link_open'] . $currentPageNumber . $this->config['active_link_close'];
248
-                }
249
-                else{
238
+                } else{
250 239
                     $navbar .= $this->config['digit_open'] 
251 240
                             . '<a href="' . $query . $i . '" ' . attributes_to_string($this->config['attributes']) . '>' . $i . '</a>' 
252 241
                             . $this->config['digit_close'];
@@ -274,8 +263,7 @@  discard block
 block discarded – undo
274 263
             for($i = $begin; $i <= $end; $i++){
275 264
                 if ($i == $currentPageNumber){
276 265
                     $navbar .= $this->config['active_link_open'] . $currentPageNumber . $this->config['active_link_close'];
277
-                }
278
-                else{
266
+                } else{
279 267
                     $navbar .= $this->config['digit_open'] 
280 268
                                     . '<a href="' . $query . $i . '"' . attributes_to_string($this->config['attributes']) . '>' . $i .'</a>' 
281 269
                                     . $this->config['digit_close'];
@@ -303,8 +291,7 @@  discard block
 block discarded – undo
303 291
                     $navbar .= $this->config['active_link_open'] 
304 292
                                 . $currentPageNumber 
305 293
                                 . $this->config['active_link_close'];
306
-                }
307
-                else{
294
+                } else{
308 295
                     $navbar .= $this->config['digit_open'] 
309 296
                                 . '<a href="' . $query . $i . '"' . attributes_to_string($this->config['attributes']) . '>' . $i . '</a>' 
310 297
                                 . $this->config['digit_close'];
Please login to merge, or discard this patch.
core/classes/Module.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,8 +61,7 @@
 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
 				}
Please login to merge, or discard this patch.
core/classes/Response.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -210,8 +210,7 @@  discard block
 block discarded – undo
210 210
 			if($moduleViewPath){
211 211
 				$path = $moduleViewPath;
212 212
 				$logger->info('Found view [' . $view . '] in module [' .$module. '], the file path is [' .$moduleViewPath. '] we will used it');
213
-			}
214
-			else{
213
+			} else{
215 214
 				$logger->info('Cannot find view [' . $view . '] in module [' .$module. '] using the default location');
216 215
 			}
217 216
 			
@@ -335,8 +334,7 @@  discard block
 block discarded – undo
335 334
 				$output = ob_get_clean();
336 335
 				self::sendHeaders(404);
337 336
 				echo $output;
338
-			}
339
-			else{
337
+			} else{
340 338
 				show_error('The 404 view [' .$path. '] does not exist');
341 339
 			}
342 340
 		}
@@ -359,8 +357,7 @@  discard block
 block discarded – undo
359 357
 				$output = ob_get_clean();
360 358
 				self::sendHeaders(503);
361 359
 				echo $output;
362
-			}
363
-			else{
360
+			} else{
364 361
 				//can't use show_error() at this time because some dependencies not yet loaded and to prevent loop
365 362
 				set_http_status_header(503);
366 363
 				echo 'The error view [' . $path . '] does not exist';
Please login to merge, or discard this patch.