Passed
Branch 1.0.0-dev (c78053)
by nguereza
04:10 queued 15s
created
index.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -242,8 +242,7 @@
 block discarded – undo
242 242
 			ini_set('display_errors', 0);
243 243
 			if (version_compare(PHP_VERSION, '5.3', '>=')) {
244 244
 				error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
245
-			}
246
-			else{
245
+			} else{
247 246
 				error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
248 247
 			}
249 248
 		break;
Please login to merge, or discard this patch.
core/bootstrap.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -78,8 +78,7 @@  discard block
 block discarded – undo
78 78
 	*/
79 79
 	if (version_compare(phpversion(), TNH_REQUIRED_PHP_MIN_VERSION, '<')){
80 80
 		show_error('Your PHP Version [' . phpversion() . '] is less than [' . TNH_REQUIRED_PHP_MIN_VERSION . '], please install a new version or update your PHP to the latest.', 'PHP Error environment');	
81
-	}
82
-	else if(version_compare(phpversion(), TNH_REQUIRED_PHP_MAX_VERSION, '>')){
81
+	} else if(version_compare(phpversion(), TNH_REQUIRED_PHP_MAX_VERSION, '>')){
83 82
 		show_error('Your PHP Version [' . phpversion() . '] is greather than [' . TNH_REQUIRED_PHP_MAX_VERSION . '] please install a PHP version that is compatible.', 'PHP Error environment');	
84 83
 	}
85 84
 	$LOGGER->info('PHP version [' . phpversion() . '] is OK [REQUIRED MINIMUM: ' . TNH_REQUIRED_PHP_MIN_VERSION . ', REQUIRED MAXIMUM: ' . TNH_REQUIRED_PHP_MAX_VERSION . '], application can work without any issue');
@@ -104,8 +103,7 @@  discard block
 block discarded – undo
104 103
 	if(file_exists(VENDOR_PATH . 'autoload.php')){
105 104
 		$LOGGER->info('The composer autoload file exists include it');
106 105
 		require_once VENDOR_PATH . 'autoload.php';
107
-	}
108
-	else{
106
+	} else{
109 107
 		$LOGGER->info('The composer autoload file does not exist skipping');
110 108
 	}
111 109
 	
@@ -176,8 +174,7 @@  discard block
 block discarded – undo
176 174
 		//first check if the cache handler is the system driver
177 175
 		if(file_exists(CORE_CLASSES_CACHE_PATH . $cacheHandler . '.php')){
178 176
 			$CACHE =& class_loader($cacheHandler, 'classes/cache');
179
-		}
180
-		else{
177
+		} else{
181 178
 			//it's not a system driver use user library
182 179
 			$CACHE =& class_loader($cacheHandler);
183 180
 		}
Please login to merge, or discard this patch.
core/classes/Url.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -62,8 +62,7 @@  discard block
 block discarded – undo
62 62
 					$query[0] = rtrim($query[0], '/');
63 63
 					$query[0] .= $suffix;
64 64
 					$path = implode('?', $query);
65
-				}
66
-				else{
65
+				} else{
67 66
 					$path .= $suffix;
68 67
 				}
69 68
 			}
@@ -119,11 +118,9 @@  discard block
 block discarded – undo
119 118
 			
120 119
 			if($obj->request->server('HTTP_HOST')){
121 120
 				$domain = $obj->request->server('HTTP_HOST');
122
-			}
123
-			else if($obj->request->server('SERVER_NAME')){
121
+			} else if($obj->request->server('SERVER_NAME')){
124 122
 				$domain = $obj->request->server('SERVER_NAME');
125
-			}
126
-			else if($obj->request->server('SERVER_ADDR')){
123
+			} else if($obj->request->server('SERVER_ADDR')){
127 124
 				$domain = $obj->request->server('SERVER_ADDR');
128 125
 			}
129 126
 			if($port && (is_https() && $port != 443 || !is_https() && $port != 80)){
Please login to merge, or discard this patch.
core/classes/Session.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -90,8 +90,7 @@  discard block
 block discarded – undo
90 90
 			($_SESSION[$key]) : $default;
91 91
 			if(array_key_exists($key, $_SESSION)){
92 92
 				unset($_SESSION[$key]);
93
-			}
94
-			else{
93
+			} else{
95 94
 				$logger->warning('Cannot find session flash item ['. $key .'] using the default value ['. $default .']');
96 95
 			}
97 96
 			return $return;
@@ -126,8 +125,7 @@  discard block
 block discarded – undo
126 125
 			if(array_key_exists($item, $_SESSION)){
127 126
 				$logger->info('Deleting of session for item ['.$item.' ]');
128 127
 				unset($_SESSION[$item]);
129
-			}
130
-			else{
128
+			} else{
131 129
 				$logger->warning('Session item ['.$item.'] to be deleted does not exists');
132 130
 			}
133 131
 		}
@@ -142,8 +140,7 @@  discard block
 block discarded – undo
142 140
 			if(array_key_exists($key, $_SESSION)){
143 141
 				$logger->info('Delete session flash for item ['.$item.']');
144 142
 				unset($_SESSION[$item]);
145
-			}
146
-			else{
143
+			} else{
147 144
 				$logger->warning('Dession flash item ['.$item.'] to be deleted does not exists');
148 145
 			}
149 146
 		}
Please login to merge, or discard this patch.
core/classes/Lang.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -82,8 +82,7 @@  discard block
 block discarded – undo
82 82
 			if($cookieLang && $this->isValid($cookieLang)){
83 83
 				$this->current = $cookieLang;
84 84
 				$this->logger->info('Language from cookie [' .$cfgKey. '] is valid so we will set the language using the cookie value [' .$cookieLang. ']');
85
-			}
86
-			else{
85
+			} else{
87 86
 				$this->logger->info('Language from cookie [' .$cfgKey. '] is not set, use the default value [' .$this->getDefault(). ']');
88 87
 				$this->current = $this->getDefault();
89 88
 			}
@@ -171,8 +170,7 @@  discard block
 block discarded – undo
171 170
 			}
172 171
 			if($this->isValid($name)){
173 172
 				$this->availables[$name] = $description;
174
-			}
175
-			else{
173
+			} else{
176 174
 				show_error('The language [' . $name . '] is not valid or does not exists.');
177 175
 			}
178 176
 		}
Please login to merge, or discard this patch.
core/classes/Security.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -60,8 +60,7 @@  discard block
 block discarded – undo
60 60
 			if(Session::exists($key) && Session::exists($keyExpire) && Session::get($keyExpire) > $currentTime){
61 61
 				$logger->info('The CSRF token not yet expire just return it');
62 62
 				return Session::get($key);
63
-			}
64
-			else{
63
+			} else{
65 64
 				$newTime = $currentTime + $expire;
66 65
 				$token = sha1(uniqid()) . sha1(uniqid());
67 66
 				$logger->info('The CSRF informations are listed below: key [' .$key. '], key expire [' .$keyExpire. '], expire time [' .$expire. '], token [' .$token. ']');
@@ -87,8 +86,7 @@  discard block
 block discarded – undo
87 86
 			if(! Session::exists($key) || Session::get($keyExpire) <= $currentTime){
88 87
 				$logger->warning('The CSRF session data is not valide');
89 88
 				return false;
90
-			}
91
-			else{
89
+			} else{
92 90
 				//perform form data
93 91
 				//need use request->query() for best retrieve
94 92
 				//super instance
@@ -97,8 +95,7 @@  discard block
 block discarded – undo
97 95
 				if(! $token || $token !== Session::get($key) || Session::get($keyExpire) <= $currentTime){
98 96
 					$logger->warning('The CSRF data [' .$token. '] is not valide may be attacker do his job');
99 97
 					return false;
100
-				}
101
-				else{
98
+				} else{
102 99
 					$logger->info('The CSRF data [' .$token. '] is valide the form data is safe continue');
103 100
 					//remove the token from session
104 101
 					Session::clear($key);
@@ -127,8 +124,7 @@  discard block
 block discarded – undo
127 124
 						$logger->info('IP address ' . $ip . ' allowed using the wildcard "*" or the full IP');
128 125
 						//wildcard to access all ip address
129 126
 						return;
130
-					}
131
-					else{
127
+					} else{
132 128
 						// go through all whitelisted ips
133 129
 						foreach ($list as $ipaddr) {
134 130
 							// find the wild card * in whitelisted ip (f.e. find position in "127.0.*" or "127*")
@@ -153,8 +149,7 @@  discard block
 block discarded – undo
153 149
 						show_error('Access to this application is not allowed');
154 150
 					}
155 151
 				}
156
-			}
157
-			else{
152
+			} else{
158 153
 				$logger->info('Whitelist IP access is not enabled in the configuration, ignore checking');
159 154
 			}
160 155
 		 }
Please login to merge, or discard this patch.
core/classes/Request.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -103,8 +103,7 @@
 block discarded – undo
103 103
 			$this->header = array();
104 104
 			if(function_exists('apache_request_headers')){
105 105
 				$this->header = apache_request_headers();
106
-			}
107
-			else if(function_exists('getallheaders')){
106
+			} else if(function_exists('getallheaders')){
108 107
 				$this->header = getallheaders();
109 108
 			}
110 109
 		}
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.