Completed
Branch master (96e8d2)
by judicael
07:21 queued 03:32
created
bundles/ext/facebook/base_facebook.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -361,8 +361,7 @@
 block discarded – undo
361 361
           'fb_exchange_token' => $this->getAccessToken(),
362 362
         )
363 363
       );
364
-    }
365
-    catch (FacebookApiException $e) {
364
+    } catch (FacebookApiException $e) {
366 365
       // most likely that user very recently revoked authorization.
367 366
       // In any event, we don't have an access token, so say so.
368 367
       return false;
Please login to merge, or discard this patch.
bundles/tests/Demo/app/Controller/Exemple1Test.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,12 +56,10 @@
 block discarded – undo
56 56
             if ($content) {
57 57
 
58 58
                 $this->assertTrue(true);
59
-            }
60
-            else {
59
+            } else {
61 60
                 $this->assertTrue(false);
62 61
             }
63
-        }
64
-        catch(\Exception $e) {
62
+        } catch(\Exception $e) {
65 63
             $this->assertTrue(false);
66 64
         }
67 65
 
Please login to merge, or discard this patch.
bundles/lib/Ldap.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -113,8 +113,7 @@
 block discarded – undo
113 113
 	 */
114 114
 	public function unbind() : bool
115 115
 	{
116
-	    if ($this->_bConnected) { return $this->_bConnected = ldap_unbind($this->_rConnect); }
117
-	    else { return true; }
116
+	    if ($this->_bConnected) { return $this->_bConnected = ldap_unbind($this->_rConnect); } else { return true; }
118 117
 	}
119 118
 
120 119
 	/**
Please login to merge, or discard this patch.
bundles/lib/Image.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@  discard block
 block discarded – undo
57 57
         if ($bKeepDimension === false) {
58 58
         
59 59
             imagecopyresampled($rNewImage, $rActualImage, 0, 0, 0, 0, $iWidth, $iHeight, $aSize[0], $aSize[1]);
60
-        }
61
-        else {
60
+        } else {
62 61
         
63 62
             if ($aSize[0] > $aSize[1]) {
64 63
 
@@ -68,8 +67,7 @@  discard block
 block discarded – undo
68 67
                 $iHeight = round($iWidth * $fCoef);
69 68
                 $iDestY = round(($iWidth - $iHeight) / 2);
70 69
                 $iDestX = 0;
71
-            }
72
-            else {
70
+            } else {
73 71
 
74 72
                 $rWhite = imagecolorallocate($rNewImage, 255, 255, 255);
75 73
                 imagefilledrectangle($rNewImage, 0, 0, $iWidth, $iHeight, $rWhite);
Please login to merge, or discard this patch.
bundles/lib/Cache.php 1 patch
Braces   +7 added lines, -17 removed lines patch added patch discarded remove patch
@@ -60,11 +60,7 @@  discard block
 block discarded – undo
60 60
 	 */
61 61
 	public static function setCacheType(string $sCacheName)
62 62
 	{
63
-		if ($sCacheName === 'file') { self::$_sTypeOfCache = 'file'; }
64
-		else if ($sCacheName === 'memcache') { self::$_sTypeOfCache = 'memcache'; }
65
-		else if ($sCacheName === 'apc') { self::$_sTypeOfCache = 'apc'; }
66
-		else if ($sCacheName === 'redis') { self::$_sTypeOfCache = 'redis'; }
67
-		else { self::$_sTypeOfCache = 'mock'; }
63
+		if ($sCacheName === 'file') { self::$_sTypeOfCache = 'file'; } else if ($sCacheName === 'memcache') { self::$_sTypeOfCache = 'memcache'; } else if ($sCacheName === 'apc') { self::$_sTypeOfCache = 'apc'; } else if ($sCacheName === 'redis') { self::$_sTypeOfCache = 'redis'; } else { self::$_sTypeOfCache = 'mock'; }
68 64
 	}
69 65
 
70 66
 	/**
@@ -132,31 +128,26 @@  discard block
 block discarded – undo
132 128
 			if (!isset(self::$_aCache['file'])) { self::$_aCache['file'] = new CacheFile; }
133 129
 
134 130
 			return self::$_aCache['file'];
135
-		}
136
-		else if (self::$_sTypeOfCache === 'memcache') {
131
+		} else if (self::$_sTypeOfCache === 'memcache') {
137 132
   		  
138 133
 			if (!isset(self::$_aCache['memcache'])) { 
139 134
 			    
140 135
 			    $oDbConf = Config::get('Memcache')->configuration;
141 136
 			    
142
-			    if (isset($oDbConf->port)) { $sPort = $oDbConf->port; }
143
-			    else { $sPort = null; }
137
+			    if (isset($oDbConf->port)) { $sPort = $oDbConf->port; } else { $sPort = null; }
144 138
 			    
145
-			    if (isset($oDbConf->timeout)) { $iTimeout = $oDbConf->timeout; }
146
-			    else { $iTimeout = null; }
139
+			    if (isset($oDbConf->timeout)) { $iTimeout = $oDbConf->timeout; } else { $iTimeout = null; }
147 140
 			    
148 141
 			    self::$_aCache['memcache'] = new CacheMemcache($oDbConf->host, $sPort, $iTimeout); 
149 142
 			}
150 143
 
151 144
 			return self::$_aCache['memcache'];
152
-		}
153
-		else if (self::$_sTypeOfCache === 'apc') {
145
+		} else if (self::$_sTypeOfCache === 'apc') {
154 146
 
155 147
 			if (!isset(self::$_aCache['apc'])) { self::$_aCache['apc'] = new Apc; }
156 148
 
157 149
 			return self::$_aCache['apc'];
158
-		}
159
-		else if (self::$_sTypeOfCache === 'redis') {
150
+		} else if (self::$_sTypeOfCache === 'redis') {
160 151
 		    
161 152
 			if (!isset(self::$_aCache['redis'])) {
162 153
 			    
@@ -165,8 +156,7 @@  discard block
 block discarded – undo
165 156
 			}
166 157
 
167 158
 			return self::$_aCache['redis'];
168
-		}
169
-		else if (self::$_sTypeOfCache === 'mock') {
159
+		} else if (self::$_sTypeOfCache === 'mock') {
170 160
 		    
171 161
 			if (!isset(self::$_aCache['mock'])) { self::$_aCache['mock'] = new Mock; }
172 162
 
Please login to merge, or discard this patch.
bundles/lib/Response.php 1 patch
Braces   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -227,9 +227,7 @@
 block discarded – undo
227 227
 	 */
228 228
 	public function translate($mContent)
229 229
 	{
230
-		if (self::$_sKindOfReturn === 'yaml') { return Yaml::translate($mContent); }
231
-		else if (self::$_sKindOfReturn === 'mock') { return Mock::translate($mContent); }
232
-		else { return Json::translate($mContent); }
230
+		if (self::$_sKindOfReturn === 'yaml') { return Yaml::translate($mContent); } else if (self::$_sKindOfReturn === 'mock') { return Mock::translate($mContent); } else { return Json::translate($mContent); }
233 231
 	}
234 232
 
235 233
 	/**
Please login to merge, or discard this patch.
bundles/lib/Request.php 1 patch
Braces   +9 added lines, -21 removed lines patch added patch discarded remove patch
@@ -69,8 +69,7 @@  discard block
 block discarded – undo
69 69
 			if (array_key_exists('HTTP_X_REQUESTED_WITH', $_SERVER) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
70 70
 
71 71
 				return true;
72
-			}
73
-			else {
72
+			} else {
74 73
 
75 74
 				return false;
76 75
 			}
@@ -85,8 +84,7 @@  discard block
 block discarded – undo
85 84
 	 */
86 85
 	public static function isHttpRequest()
87 86
 	{
88
-		if (isset($_SERVER) && isset($_SERVER['HTTP_HOST'])) { return true; }
89
-		else { return false; }
87
+		if (isset($_SERVER) && isset($_SERVER['HTTP_HOST'])) { return true; } else { return false; }
90 88
 	}
91 89
 
92 90
 	/**
@@ -97,8 +95,7 @@  discard block
 block discarded – undo
97 95
 	 */
98 96
 	public static function isHttpsRequest()
99 97
 	{
100
-		if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') { return true; }
101
-		else { return false; }
98
+		if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') { return true; } else { return false; }
102 99
 	}
103 100
 
104 101
 	/**
@@ -111,8 +108,7 @@  discard block
 block discarded – undo
111 108
 	{
112 109
 		$sSapiType = php_sapi_name();
113 110
 
114
-		if (substr($sSapiType, 0, 3) == 'cgi' || defined('STDIN')) { return true; }
115
-		else { return false; }
111
+		if (substr($sSapiType, 0, 3) == 'cgi' || defined('STDIN')) { return true; } else { return false; }
116 112
 	}
117 113
 
118 114
 	/**
@@ -137,8 +133,7 @@  discard block
 block discarded – undo
137 133
 	 */
138 134
 	public static function getParameters()
139 135
 	{
140
-		if (isset($_GET)) { return $_GET; }
141
-		else { return array(); }
136
+		if (isset($_GET)) { return $_GET; } else { return array(); }
142 137
 	}
143 138
 
144 139
 	/**
@@ -149,8 +144,7 @@  discard block
 block discarded – undo
149 144
 	 */
150 145
 	public static function getPostParameters()
151 146
 	{
152
-		if (isset($_POST)) { return $_POST; }
153
-		else { return array(); }
147
+		if (isset($_POST)) { return $_POST; } else { return array(); }
154 148
 	}
155 149
 
156 150
 	/**
@@ -161,8 +155,7 @@  discard block
 block discarded – undo
161 155
 	 */
162 156
 	public function isPost()
163 157
 	{
164
-		if (isset($_POST) && count($_POST) > 0) { return true; }
165
-		else { return false; }
158
+		if (isset($_POST) && count($_POST) > 0) { return true; } else { return false; }
166 159
 	}
167 160
 
168 161
 	/**
@@ -214,11 +207,7 @@  discard block
 block discarded – undo
214 207
 	 */
215 208
 	public static function setStatus($iCode)
216 209
 	{
217
-		if ($iCode === 200) { header('HTTP/1.1 200 Ok');  }
218
-		else if ($iCode === 201) { header('HTTP/1.1 201 Created');  }
219
-		else if ($iCode === 204) { header("HTTP/1.0 204 No Content");  }
220
-		else if ($iCode === 403) { header('HTTP/1.1 403 Forbidden'); }
221
-		else if ($iCode === 404) { header('HTTP/1.1 404 Not Found'); }
210
+		if ($iCode === 200) { header('HTTP/1.1 200 Ok');  } else if ($iCode === 201) { header('HTTP/1.1 201 Created');  } else if ($iCode === 204) { header("HTTP/1.0 204 No Content");  } else if ($iCode === 403) { header('HTTP/1.1 403 Forbidden'); } else if ($iCode === 404) { header('HTTP/1.1 404 Not Found'); }
222 211
 	}
223 212
 
224 213
     /**
@@ -236,8 +225,7 @@  discard block
 block discarded – undo
236 225
      */
237 226
     public function getLanguages() : array
238 227
     {
239
-        if (!self::isCliRequest()) { return explode(',', preg_replace('/^([^;]);?.*$/', '$1', $_SERVER['HTTP_ACCEPT_LANGUAGE'])); }
240
-        else { return array(); }
228
+        if (!self::isCliRequest()) { return explode(',', preg_replace('/^([^;]);?.*$/', '$1', $_SERVER['HTTP_ACCEPT_LANGUAGE'])); } else { return array(); }
241 229
     }
242 230
 
243 231
 	/**
Please login to merge, or discard this patch.
bundles/lib/I18n.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
                 $fCallBack = function($sValue) use ($oJson)
53 53
                 {    
54
-                    if (isset($oJson->$sValue)) { return $oJson->$sValue; }
55
-                    else { return ''; }
54
+                    if (isset($oJson->$sValue)) { return $oJson->$sValue; } else { return ''; }
56 55
                 };
57 56
             }
58 57
             
Please login to merge, or discard this patch.
bundles/lib/Date.php 1 patch
Braces   +9 added lines, -33 removed lines patch added patch discarded remove patch
@@ -43,11 +43,9 @@  discard block
 block discarded – undo
43 43
 	{
44 44
 		$iFirstDayInYear = date("N",mktime(0, 0, 0, 1, 1, $iYear));
45 45
 
46
-		if ($iFirstDayInYear < 5) { $iShift = -($iFirstDayInYear - 1) * 86400; }
47
-		else { $iShift = (8 - $iFirstDayInYear) * 86400; }
46
+		if ($iFirstDayInYear < 5) { $iShift = -($iFirstDayInYear - 1) * 86400; } else { $iShift = (8 - $iFirstDayInYear) * 86400; }
48 47
 
49
-		if ($iWeek > 1) { $iWeekInSeconds = ($iWeek-1) * 604800; }
50
-		else { $iWeekInSeconds = 0; }
48
+		if ($iWeek > 1) { $iWeekInSeconds = ($iWeek-1) * 604800; } else { $iWeekInSeconds = 0; }
51 49
 
52 50
 		$iTimestamp = mktime(0, 0, 0, 1, 1, $iYear) + $iWeekInSeconds + $iShift;
53 51
 		$iTimestampLastDay = mktime(0, 0, 0, 1, 6, $iYear) + $iWeekInSeconds + $iShift + 604800;
@@ -78,18 +76,7 @@  discard block
 block discarded – undo
78 76
 	{
79 77
 		if ($sLanguage == 'fr') {
80 78
 
81
-			if ($sMonth == '01' || $sMonth == 1) { return 'Janvier'; }
82
-			else if ($sMonth == '02' || $sMonth == 2) { return 'Février'; }
83
-			else if ($sMonth == '03' || $sMonth == 3) { return 'Mars'; }
84
-			else if ($sMonth == '04' || $sMonth == 4) { return 'Avril'; }
85
-			else if ($sMonth == '05' || $sMonth == 5) { return 'Mai'; }
86
-			else if ($sMonth == '06' || $sMonth == 6) { return 'Juin'; }
87
-			else if ($sMonth == '07' || $sMonth == 7) { return 'Juillet'; }
88
-			else if ($sMonth == '08' || $sMonth == 8) { return 'Août'; }
89
-			else if ($sMonth == '09' || $sMonth == 9) { return 'Septembre'; }
90
-			else if ($sMonth == 10) { return 'Octobre'; }
91
-			else if ($sMonth == 11) { return 'Novembre'; }
92
-			else if ($sMonth == 12) { return 'Décembre'; }
79
+			if ($sMonth == '01' || $sMonth == 1) { return 'Janvier'; } else if ($sMonth == '02' || $sMonth == 2) { return 'Février'; } else if ($sMonth == '03' || $sMonth == 3) { return 'Mars'; } else if ($sMonth == '04' || $sMonth == 4) { return 'Avril'; } else if ($sMonth == '05' || $sMonth == 5) { return 'Mai'; } else if ($sMonth == '06' || $sMonth == 6) { return 'Juin'; } else if ($sMonth == '07' || $sMonth == 7) { return 'Juillet'; } else if ($sMonth == '08' || $sMonth == 8) { return 'Août'; } else if ($sMonth == '09' || $sMonth == 9) { return 'Septembre'; } else if ($sMonth == 10) { return 'Octobre'; } else if ($sMonth == 11) { return 'Novembre'; } else if ($sMonth == 12) { return 'Décembre'; }
93 80
 		}
94 81
 	}
95 82
 
@@ -105,13 +92,7 @@  discard block
 block discarded – undo
105 92
 	{
106 93
 		if ($sLanguage == 'fr') {
107 94
 
108
-			if ($sDay == 0) { return 'dimanche'; }
109
-			else if ($sDay == 1) { return 'lundi'; }
110
-			else if ($sDay == 2) { return 'mardi'; }
111
-			else if ($sDay == 3) { return 'mercredi'; }
112
-			else if ($sDay == 4) { return 'jeudi'; }
113
-			else if ($sDay == 5) { return 'vendredi'; }
114
-			else if ($sDay == 6) { return 'samedi'; }
95
+			if ($sDay == 0) { return 'dimanche'; } else if ($sDay == 1) { return 'lundi'; } else if ($sDay == 2) { return 'mardi'; } else if ($sDay == 3) { return 'mercredi'; } else if ($sDay == 4) { return 'jeudi'; } else if ($sDay == 5) { return 'vendredi'; } else if ($sDay == 6) { return 'samedi'; }
115 96
 		}
116 97
 	}
117 98
 
@@ -138,8 +119,7 @@  discard block
 block discarded – undo
138 119
 			if ($iMonth == $aToday['mois']) {
139 120
 
140 121
 				if ($iDay > $aToday['jour']) { $iYears--; }
141
-			}
142
-			else {
122
+			} else {
143 123
 
144 124
 				$iYears--;
145 125
 			}
@@ -160,18 +140,15 @@  discard block
 block discarded – undo
160 140
 	{
161 141
 		$iFirstDayInYear = date("N",mktime(0, 0, 0, 1, 1, $iYear));
162 142
 
163
-		if ($iFirstDayInYear < 5) { $iShift = -($iFirstDayInYear - 1) * 86400; }
164
-		else { $iShift = (8 - $iFirstDayInYear) * 86400; }
143
+		if ($iFirstDayInYear < 5) { $iShift = -($iFirstDayInYear - 1) * 86400; } else { $iShift = (8 - $iFirstDayInYear) * 86400; }
165 144
 
166
-		if ($iWeek > 1) { $iWeekInSeconds = ($iWeek-1) * 604800; }
167
-		else { $iWeekInSeconds = 0; }
145
+		if ($iWeek > 1) { $iWeekInSeconds = ($iWeek-1) * 604800; } else { $iWeekInSeconds = 0; }
168 146
 
169 147
 		if (date('N') > 2) {
170 148
 
171 149
 			$iTimestamp = mktime(0, 0, 0, 1, 1, $iYear) + $iWeekInSeconds + $iShift + 172800;
172 150
 			$iTimestampLastDay = $iTimestamp + 604800;
173
-		}
174
-		else {
151
+		} else {
175 152
 
176 153
 			$iTimestamp = mktime(0, 0, 0, 1, 1, $iYear) + $iWeekInSeconds + $iShift - 432000;
177 154
 			$iTimestampLastDay = $iTimestamp + 604800;
@@ -228,7 +205,6 @@  discard block
 block discarded – undo
228 205
 		if ($iTimeStamp < 3600) { return $sStartReturn.' '.(int)($iTimeStamp/60).' '.$sMinutes.$sEndReturn; }
229 206
 		if ($iTimeStamp < 86400) { return $sStartReturn.' '.(int)($iTimeStamp/3600).' '.$sHours.$sEndReturn; }
230 207
 		if ($iTimeStamp < 2592000) { return $sStartReturn.' '.(int)($iTimeStamp/86400).' '.$sDays.$sEndReturn; }
231
-		if ($iTimeStamp < 31536000) { return $sStartReturn.' '.(int)($iTimeStamp/2592000).' '.$sMonths.$sEndReturn; }
232
-		else { return $sStartReturn.' '.(int)($iTimeStamp/31536000).' '.$sYears.$sEndReturn; }
208
+		if ($iTimeStamp < 31536000) { return $sStartReturn.' '.(int)($iTimeStamp/2592000).' '.$sMonths.$sEndReturn; } else { return $sStartReturn.' '.(int)($iTimeStamp/31536000).' '.$sYears.$sEndReturn; }
233 209
 	}
234 210
 }
Please login to merge, or discard this patch.