Passed
Branch master (e94900)
by judicael
03:54
created
bundles/lib/Object.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@
 block discarded – undo
50 50
 				$sKey = preg_replace("/^\\0(.*)\\0/", "", $sKey);
51 51
 				$aNew[$sKey] = self::object_to_array($mValues);
52 52
 			}
53
-		}
54
-		else {
53
+		} else {
55 54
 
56 55
 			$aNew = $mObject;
57 56
 		}
Please login to merge, or discard this patch.
bundles/lib/Upload.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -110,8 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
 		if ($this->_sExtension === null) { $this->setExtension($sExtension); }
112 112
 
113
-		if ($this->_sName) { $sName = $sPath.$this->_sName.'.'.$this->_sExtension; }
114
-		else { $sName = $sPath.md5(uniqid(rand(), true)).'.'.$this->_sExtension;}
113
+		if ($this->_sName) { $sName = $sPath.$this->_sName.'.'.$this->_sExtension; } else { $sName = $sPath.md5(uniqid(rand(), true)).'.'.$this->_sExtension;}
115 114
 
116 115
 		if ($this->_bProportion == true && ($this->_iWidth || $this->_iHeight)) {
117 116
 
@@ -129,8 +128,7 @@  discard block
 block discarded – undo
129 128
 			imagecopyresampled($rNewImgTrueColor , $rNewImage, 0, 0, $fX, $fY, $this->_iWidth, $this->_iHeight, $iWidth * $fRatio - $fX * 2, $iHeight * $fRatio - $fY * 2);
130 129
 
131 130
 			imagejpeg($rNewImgTrueColor , $sName, 100);
132
-		}
133
-		else {
131
+		} else {
134 132
 
135 133
 			$bResultat = move_uploaded_file($_FILES[$sFile]['tmp_name'], $sName);
136 134
 
Please login to merge, or discard this patch.
bundles/lib/Functions/Asset.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@
 block discarded – undo
51 51
     		    if (strstr($sTemplate, 'css/')) {
52 52
     			
53 53
     		        $sGetUrl .= $sTemplate.'&';
54
-    		    }
55
-    		    else if (strstr($sTemplate, 'js/')) {
54
+    		    } else if (strstr($sTemplate, 'js/')) {
56 55
     		        
57 56
     		        $sGetUrl .= $sTemplate.'&';
58 57
     		    }
Please login to merge, or discard this patch.
bundles/lib/Typescript.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@
 block discarded – undo
51 51
 	        
52 52
 	        $sCmd = self::TYPESCRIPT_WINDOWS." ".$sFile." --outDir ".__DIR__.'../../'.CACHE_DIR.$sFolder.'/';
53 53
             $sContent = shell_exec($sCmd);
54
-	    }
55
-	    else {
54
+	    } else {
56 55
 	       
57 56
 	        $sCmd = "tsc ".$sFile." --outDir ".__DIR__.'../../'.CACHE_DIR.$sFolder.'/';
58 57
             $sContent = shell_exec($sCmd);
Please login to merge, or discard this patch.
bundles/lib/Request/Headers.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@  discard block
 block discarded – undo
19 19
     {
20 20
         if (isset(apache_request_headers()[$name]) && apache_request_headers()[$name] != '') {
21 21
             return apache_request_headers()[$name];
22
-        }
23
-        else if ($default != null) {
22
+        } else if ($default != null) {
24 23
             return $default;
25 24
         }
26 25
     }
@@ -35,8 +34,7 @@  discard block
 block discarded – undo
35 34
     {
36 35
         if ($value !== null) {
37 36
             header($name . ': ' . $value);
38
-        }
39
-        else {
37
+        } else {
40 38
             header($name);
41 39
         }
42 40
         
Please login to merge, or discard this patch.
bundles/lib/Request/Cookies.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@
 block discarded – undo
19 19
     {
20 20
         if (isset($_COOKIE[$name]) && $_COOKIE[$name] != '') {
21 21
             return $_COOKIE[$name];
22
-        }
23
-        else if ($default != null) {
22
+        } else if ($default != null) {
24 23
             return $default;
25 24
         }
26 25
     }
Please login to merge, or discard this patch.
bundles/core/Security.php 1 patch
Braces   +9 added lines, -19 removed lines patch added patch discarded remove patch
@@ -95,8 +95,7 @@  discard block
 block discarded – undo
95 95
 					header('HTTP/1.0 401 Unauthorized');
96 96
 					echo $oSecurity->cancelled;
97 97
 					exit;
98
-				}
99
-				else {
98
+				} else {
100 99
 
101 100
 					self::$_sLogin = $_SERVER['PHP_AUTH_USER'];
102 101
 					self::$_sPassword = $_SERVER['PHP_AUTH_PW'];
@@ -105,8 +104,7 @@  discard block
 block discarded – undo
105 104
 					if (!$this->_checkAccess()) { return false; }
106 105
 					if (!$this->_checkBlackListIps()) { return false; }
107 106
 				}
108
-			}
109
-			else if (isset($oSecurity->authentification) && $oSecurity->authentification === 'http_basic_validate_by_controller') {
107
+			} else if (isset($oSecurity->authentification) && $oSecurity->authentification === 'http_basic_validate_by_controller') {
110 108
 
111 109
 				if (!isset($_SERVER['PHP_AUTH_USER'])) {
112 110
 
@@ -117,8 +115,7 @@  discard block
 block discarded – undo
117 115
 					header('HTTP/1.0 401 Unauthorized');
118 116
 					echo $oSecurity->cancelled;
119 117
 					exit;
120
-				}
121
-				else {
118
+				} else {
122 119
 
123 120
 					self::$_sLogin = $_SERVER['PHP_AUTH_USER'];
124 121
 					self::$_sPassword = $_SERVER['PHP_AUTH_PW'];
@@ -132,8 +129,7 @@  discard block
 block discarded – undo
132 129
 					if (!$this->_checkAccess()) { return false; }
133 130
 					if (!$this->_checkBlackListIps()) { return false; }
134 131
 				}
135
-			}
136
-			else if (isset($oSecurity->authentification) && $oSecurity->authentification === 'controller') {
132
+			} else if (isset($oSecurity->authentification) && $oSecurity->authentification === 'controller') {
137 133
 
138 134
 				// it's an action of one controller that it return true or false for the authentification
139 135
 
@@ -152,8 +148,7 @@  discard block
 block discarded – undo
152 148
 			if (isset($oSecurity->requires_channel) && $oSecurity->requires_channel == 'https' && !Request::isHttpsRequest()) {
153 149
 
154 150
 				return false;
155
-			}
156
-			else if (isset($oSecurity->requires_channel) && $oSecurity->requires_channel == 'http' && ((Request::isHttpRequest()
151
+			} else if (isset($oSecurity->requires_channel) && $oSecurity->requires_channel == 'http' && ((Request::isHttpRequest()
157 152
 				&& Request::isHttpsRequest()) || !Request::isHttpRequest())) {
158 153
 
159 154
 				return false;
@@ -180,8 +175,7 @@  discard block
 block discarded – undo
180 175
 
181 176
 				if (preg_match('#'.$sPathAccess.'#', str_replace($this->_sBaseUri, '', $_SERVER['REQUEST_URI']))) {
182 177
 
183
-					if (in_array($this->getUserRole(), $aParams->roles)) { return true; }
184
-					else { return false; }
178
+					if (in_array($this->getUserRole(), $aParams->roles)) { return true; } else { return false; }
185 179
 				}
186 180
 			}
187 181
 		}
@@ -223,9 +217,7 @@  discard block
 block discarded – undo
223 217
 		$sLogin = self::$_sLogin;
224 218
 		$sPassword = Config::get('Security')->users->$sLogin->password;
225 219
 
226
-		if ($sPassword == self::$_sPassword) { return true; }
227
-		else if ($sPassword == md5(self::$_sPassword)) { return true; }
228
-		else { return false; }
220
+		if ($sPassword == self::$_sPassword) { return true; } else if ($sPassword == md5(self::$_sPassword)) { return true; } else { return false; }
229 221
 	}
230 222
 
231 223
 	/**
@@ -241,8 +233,7 @@  discard block
 block discarded – undo
241 233
 
242 234
 			$sLogin = self::$_sLogin;
243 235
 			return Config::get('Security')->users->$sLogin->roles;
244
-		}
245
-		else {
236
+		} else {
246 237
 
247 238
 			return '';
248 239
 		}
@@ -259,8 +250,7 @@  discard block
 block discarded – undo
259 250
 
260 251
 	public function isGranted(string $sRole) : bool {
261 252
 
262
-		if ($sRole == $this->getUserRole() || $this->getUserRole() == '') { return true; }
263
-		else { return false; }
253
+		if ($sRole == $this->getUserRole() || $this->getUserRole() == '') { return true; } else { return false; }
264 254
 	}
265 255
 
266 256
 	/**
Please login to merge, or discard this patch.
bundles/core/Config.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@  discard block
 block discarded – undo
50 50
 	 */
51 51
 	public static function get(string $sName, string $sPortal = null, bool $bNoDoRedirect = false)
52 52
 	{
53
-	    if ($bNoDoRedirect === true) { $sNameCache = $sName.'_true'; }
54
-	    else { $sNameCache = $sName; }
53
+	    if ($bNoDoRedirect === true) { $sNameCache = $sName.'_true'; } else { $sNameCache = $sName; }
55 54
 	    
56 55
 		if ($sPortal === null || !is_string($sPortal)) {
57 56
 		    
@@ -59,8 +58,7 @@  discard block
 block discarded – undo
59 58
 
60 59
 				$sPortal = PORTAL;
61 60
 				$aDirectories = array($sPortal);
62
-			}
63
-		    else {
61
+			} else {
64 62
 
65 63
 				$sPortal = '';
66 64
 				$aDirectories = scandir(str_replace('core', 'src', __DIR__));
@@ -187,8 +185,7 @@  discard block
 block discarded – undo
187 185
 	{
188 186
 	    $oConfig = self::get($sName, null, true);
189 187
 
190
-	    if (isset($oConfig->redirect)) { return $oConfig->redirect; }
191
-	    else { return PORTAL; }
188
+	    if (isset($oConfig->redirect)) { return $oConfig->redirect; } else { return PORTAL; }
192 189
 	}
193 190
 
194 191
 	/**
@@ -207,8 +204,7 @@  discard block
 block discarded – undo
207 204
 
208 205
 			list($oConfFiles, $base) = self::_recursiveGet($oConfFiles, $base);
209 206
 			return $base;
210
-		}
211
-		else {
207
+		} else {
212 208
 
213 209
 			echo "The Json ".$sFileToMerge." has an error! Please verify!\n";
214 210
 			$oDebug = Debug::getInstance();
@@ -232,12 +228,10 @@  discard block
 block discarded – undo
232 228
 			if (is_object($oConfFiles) && is_object($base) && !isset($base->$sKey)) {
233 229
 
234 230
 				$base->$sKey = $oConfFiles->$sKey;
235
-			}
236
-			else if (is_array($oConfFiles) && is_array($base) && !isset($base[$sKey])) {
231
+			} else if (is_array($oConfFiles) && is_array($base) && !isset($base[$sKey])) {
237 232
 
238 233
 				$base[$sKey] = $oConfFiles[$sKey];
239
-			}
240
-			else if (!isset($base->$sKey) && is_array($mOne)) {
234
+			} else if (!isset($base->$sKey) && is_array($mOne)) {
241 235
 
242 236
 				$base->$sKey = new \StdClass;
243 237
 				list($oConfFiles, $base) = self::_recursiveGet($mOne, $base->$sKey);
Please login to merge, or discard this patch.
bundles/core/UrlManager.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -96,12 +96,10 @@
 block discarded – undo
96 96
 
97 97
 										if (preg_match('#'.$sType.'#', $aParams[$sName])) {
98 98
 
99
-											if ($aParams[$sName]) { $sRoute = str_replace('[/:'.$sName.']', '/'.$aParams[$sName], $sRoute); }
100
-											else { $sRoute = str_replace('[/:'.$sName.']', '', $sRoute); }
99
+											if ($aParams[$sName]) { $sRoute = str_replace('[/:'.$sName.']', '/'.$aParams[$sName], $sRoute); } else { $sRoute = str_replace('[/:'.$sName.']', '', $sRoute); }
101 100
 											$sRoute = str_replace('[:'.$sName.']', $aParams[$sName], $sRoute);
102 101
 											continue;
103
-										}
104
-										else if (isset($oRoute->defaults_constraints) 
102
+										} else if (isset($oRoute->defaults_constraints) 
105 103
 											&& isset($oRoute->defaults_constraints->{$sName}) 
106 104
 											&& preg_match('#'.$sType.'#', $oRoute->defaults_constraints->{$sName})) {
107 105
 
Please login to merge, or discard this patch.