Passed
Branch 1.0.0-dev (c78053)
by nguereza
04:10 queued 15s
created
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/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.
core/libraries/Browser.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -921,20 +921,15 @@
 block discarded – undo
921 921
                     if(preg_match('#trident/([0-9\.]+);#i', $this->_agent, $aresult)){
922 922
                         if($aresult[1] == '3.1'){
923 923
                             $this->setVersion('7.0');
924
-                        }
925
-                        else if($aresult[1] == '4.0'){
924
+                        } else if($aresult[1] == '4.0'){
926 925
                             $this->setVersion('8.0');
927
-                        }
928
-                        else if($aresult[1] == '5.0'){
926
+                        } else if($aresult[1] == '5.0'){
929 927
                             $this->setVersion('9.0');
930
-                        }
931
-                        else if($aresult[1] == '6.0'){
928
+                        } else if($aresult[1] == '6.0'){
932 929
                             $this->setVersion('10.0');
933
-                        }
934
-                        else if($aresult[1] == '7.0'){
930
+                        } else if($aresult[1] == '7.0'){
935 931
                             $this->setVersion('11.0');
936
-                        }
937
-                        else if($aresult[1] == '8.0'){
932
+                        } else if($aresult[1] == '8.0'){
938 933
                             $this->setVersion('11.0');
939 934
                         }
940 935
                     }
Please login to merge, or discard this patch.
core/functions/function_user_agent.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -55,17 +55,13 @@
 block discarded – undo
55 55
 
56 56
 			if (isset($_SERVER["HTTP_CLIENT_IP"])) {
57 57
 				$ip = $_SERVER["HTTP_CLIENT_IP"];
58
-			}
59
-			else if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
58
+			} else if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
60 59
 				$ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
61
-			} 
62
-			else if (isset($_SERVER["HTTP_X_FORWARDED"])) {
60
+			} else if (isset($_SERVER["HTTP_X_FORWARDED"])) {
63 61
 				$ip = $_SERVER["HTTP_X_FORWARDED"];
64
-			} 
65
-			else if (isset($_SERVER["HTTP_FORWARDED_FOR"])) {
62
+			} else if (isset($_SERVER["HTTP_FORWARDED_FOR"])) {
66 63
 				$ip = $_SERVER["HTTP_FORWARDED_FOR"];
67
-			} 
68
-			else if (isset($_SERVER["HTTP_FORWARDED"])) {
64
+			} else if (isset($_SERVER["HTTP_FORWARDED"])) {
69 65
 				$ip = $_SERVER["HTTP_FORWARDED"];
70 66
 			} 
71 67
 
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
@@ -42,8 +42,7 @@
 block discarded – undo
42 42
 		if(isset($classesMap[$class])){
43 43
 			if(file_exists($classesMap[$class])){
44 44
 				include_once $classesMap[$class];
45
-			}
46
-			else{
45
+			} else{
47 46
 				echo 'File for class ' . $class . ' not found';
48 47
 			}
49 48
 		}
Please login to merge, or discard this patch.
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.