Completed
Push — master ( 016764...50d24f )
by judicael
04:08
created
bundles/ext/facebook/base_facebook.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
    * @return string The string representation of the error
99 99
    */
100 100
   public function __toString() {
101
-    $str = $this->getType() . ': ';
101
+    $str = $this->getType().': ';
102 102
     if ($this->code != 0) {
103
-      $str .= $this->code . ': ';
103
+      $str .= $this->code.': ';
104 104
     }
105
-    return $str . $this->message;
105
+    return $str.$this->message;
106 106
   }
107 107
 }
108 108
 
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
       if (array_key_exists('user_id', $signed_request)) {
531 531
         $user = $signed_request['user_id'];
532 532
 
533
-        if($user != $this->getPersistentData('user_id')){
533
+        if ($user != $this->getPersistentData('user_id')) {
534 534
           $this->clearAllPersistentData();
535 535
         }
536 536
 
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
    * @param array $params Provide custom parameters
577 577
    * @return string The URL for the login flow
578 578
    */
579
-  public function getLoginUrl($params=array()) {
579
+  public function getLoginUrl($params = array()) {
580 580
     $this->establishCSRFTokenState();
581 581
     $currentUrl = $this->getCurrentUrl();
582 582
 
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
    * @param array $params Provide custom parameters
606 606
    * @return string The URL for the logout flow
607 607
    */
608
-  public function getLogoutUrl($params=array()) {
608
+  public function getLogoutUrl($params = array()) {
609 609
     return $this->getUrl(
610 610
       'www',
611 611
       'logout.php',
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
    * @param array $params Provide custom parameters
628 628
    * @return string The URL for the logout flow
629 629
    */
630
-  public function getLoginStatusUrl($params=array()) {
630
+  public function getLoginStatusUrl($params = array()) {
631 631
     return $this->getUrl(
632 632
       'www',
633 633
       'extern/login_status.php',
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
    *
938 938
    * @return string The response text
939 939
    */
940
-  protected function makeRequest($url, $params, $ch=null) {
940
+  protected function makeRequest($url, $params, $ch = null) {
941 941
     if (!$ch) {
942 942
       $ch = curl_init();
943 943
     }
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
       self::errorLog('Invalid or no certificate authority found, '.
968 968
                      'using bundled information');
969 969
       curl_setopt($ch, CURLOPT_CAINFO,
970
-                  dirname(__FILE__) . '/fb_ca_chain_bundle.crt');
970
+                  dirname(__FILE__).'/fb_ca_chain_bundle.crt');
971 971
       $result = curl_exec($ch);
972 972
     }
973 973
 
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
 
1021 1021
     if (strtoupper($data['algorithm']) !== self::SIGNED_REQUEST_ALGORITHM) {
1022 1022
       self::errorLog(
1023
-        'Unknown algorithm. Expected ' . self::SIGNED_REQUEST_ALGORITHM);
1023
+        'Unknown algorithm. Expected '.self::SIGNED_REQUEST_ALGORITHM);
1024 1024
       return null;
1025 1025
     }
1026 1026
 
@@ -1044,7 +1044,7 @@  discard block
 block discarded – undo
1044 1044
   protected function makeSignedRequest($data) {
1045 1045
     if (!is_array($data)) {
1046 1046
       throw new InvalidArgumentException(
1047
-        'makeSignedRequest expects an array. Got: ' . print_r($data, true));
1047
+        'makeSignedRequest expects an array. Got: '.print_r($data, true));
1048 1048
     }
1049 1049
     $data['algorithm'] = self::SIGNED_REQUEST_ALGORITHM;
1050 1050
     $data['issued_at'] = time();
@@ -1141,7 +1141,7 @@  discard block
 block discarded – undo
1141 1141
    *
1142 1142
    * @return string The URL for the given parameters
1143 1143
    */
1144
-  protected function getUrl($name, $path='', $params=array()) {
1144
+  protected function getUrl($name, $path = '', $params = array()) {
1145 1145
     $url = self::$DOMAIN_MAP[$name];
1146 1146
     if ($path) {
1147 1147
       if ($path[0] === '/') {
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
       $url .= $path;
1151 1151
     }
1152 1152
     if ($params) {
1153
-      $url .= '?' . http_build_query($params, null, '&');
1153
+      $url .= '?'.http_build_query($params, null, '&');
1154 1154
     }
1155 1155
 
1156 1156
     return $url;
@@ -1206,7 +1206,7 @@  discard block
 block discarded – undo
1206 1206
    * @return string The current URL
1207 1207
    */
1208 1208
   protected function getCurrentUrl() {
1209
-    $protocol = $this->getHttpProtocol() . '://';
1209
+    $protocol = $this->getHttpProtocol().'://';
1210 1210
     $host = $this->getHttpHost();
1211 1211
     $currentUrl = $protocol.$host.$_SERVER['REQUEST_URI'];
1212 1212
     $parts = parse_url($currentUrl);
@@ -1232,10 +1232,10 @@  discard block
 block discarded – undo
1232 1232
       isset($parts['port']) &&
1233 1233
       (($protocol === 'http://' && $parts['port'] !== 80) ||
1234 1234
        ($protocol === 'https://' && $parts['port'] !== 443))
1235
-      ? ':' . $parts['port'] : '';
1235
+      ? ':'.$parts['port'] : '';
1236 1236
 
1237 1237
     // rebuild
1238
-    return $protocol . $parts['host'] . $port . $parts['path'] . $query;
1238
+    return $protocol.$parts['host'].$port.$parts['path'].$query;
1239 1239
   }
1240 1240
 
1241 1241
   /**
Please login to merge, or discard this 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/ext/facebook/facebook.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@
 block discarded – undo
147 147
   }
148 148
 
149 149
   protected function getSharedSessionCookieName() {
150
-    return self::FBSS_COOKIE_NAME . '_' . $this->getAppId();
150
+    return self::FBSS_COOKIE_NAME.'_'.$this->getAppId();
151 151
   }
152 152
 
153 153
   protected function constructSessionVariableName($key) {
Please login to merge, or discard this patch.
bundles/tests/Demo/app/Controller/Exemple1Test.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
                 $this->assertTrue(false);
62 62
             }
63 63
         }
64
-        catch(\Exception $e) {
64
+        catch (\Exception $e) {
65 65
             $this->assertTrue(false);
66 66
         }
67 67
 
Please login to merge, or discard this 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 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
 	 */
80 80
     public function getGroups() : array
81 81
     {
82
-        $rSearch = ldap_search( $this->_rConnect , $this->_sBase , "objectclass=group" , array("cn") );
82
+        $rSearch = ldap_search($this->_rConnect, $this->_sBase, "objectclass=group", array("cn"));
83 83
         $aEntries = ldap_get_entries($this->_rConnect, $rSearch);
84 84
         $aGroups = array();
85 85
 
86
-        for ( $i = 0 ; $i < $aEntries["count"] ; $i++ ) {
86
+        for ($i = 0; $i < $aEntries["count"]; $i++) {
87 87
             
88 88
             $aGroups[] = utf8_encode($aEntries[$i]["dn"]);
89 89
         }
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 		    
192 192
 			$aResultSet[$i] = array_intersect_key($aEntries[$i], $aMask);
193 193
 
194
-			foreach($aResultSet[$i] as &$aValues) {
194
+			foreach ($aResultSet[$i] as &$aValues) {
195 195
 			    
196 196
 				unset($aValues['count']);
197 197
 			}
Please login to merge, or discard this 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 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	    $ImageChoisie = imagecreatefromjpeg($_FILES['ImageNews']['tmp_name']);
53 53
         $TailleImageChoisie = getimagesize($_FILES['ImageNews']['tmp_name']);
54 54
 
55
-        $rNewImage = imagecreatetruecolor($iWidth , $iHeight);
55
+        $rNewImage = imagecreatetruecolor($iWidth, $iHeight);
56 56
 
57 57
         if ($bKeepDimension === false) {
58 58
         
@@ -89,6 +89,6 @@  discard block
 block discarded – undo
89 89
         $NomImageExploitable = time();
90 90
       
91 91
         header('Content-Type: image/jpeg');
92
-        imagejpeg($rNewImage , null, 100);
92
+        imagejpeg($rNewImage, null, 100);
93 93
 	}
94 94
 }
Please login to merge, or discard this 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 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
 	 * @param  int $iTimeout expiration of cache
92 92
 	 * @return bool
93 93
 	 */
94
-	public static function get(string $sName, int &$iFlags = null, int $iTimeout = 0) : bool
94
+	public static function get(string $sName, int&$iFlags = null, int $iTimeout = 0) : bool
95 95
 	{
96 96
 		return self::_getCacheObject()->get($sName, $iFlags, $iTimeout);
97 97
 	}
Please login to merge, or discard this 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/Asset.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	    $aJavascript = func_get_args();
45 45
 	    $aReturns = array();
46 46
 	    
47
-	    foreach($aJavascript as $aJsCombination) {
47
+	    foreach ($aJavascript as $aJsCombination) {
48 48
 	        
49 49
 	        $sJsPath = $sDefaultPath;
50 50
 	        
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	    $aCss = func_get_args();
80 80
 	    $aReturns = array();
81 81
 	    
82
-	    foreach($aCss as $aCssCombination) {
82
+	    foreach ($aCss as $aCssCombination) {
83 83
 	        
84 84
 	        $sCssPath = $sDefaultPath;
85 85
 	        
Please login to merge, or discard this patch.
bundles/lib/Debug.php 2 patches
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -254,8 +254,7 @@  discard block
 block discarded – undo
254 254
   	 */
255 255
   	public static function setKindOfReportLog(string $sKindOfReportLog)
256 256
   	{
257
-  		if ($sKindOfReportLog === 'screen' || $sKindOfReportLog === 'all') { self::$_sKindOfReportLog = $sKindOfReportLog; }
258
-  		else { self::$_sKindOfReportLog = 'error_log'; }
257
+  		if ($sKindOfReportLog === 'screen' || $sKindOfReportLog === 'all') { self::$_sKindOfReportLog = $sKindOfReportLog; } else { self::$_sKindOfReportLog = 'error_log'; }
259 258
   	}
260 259
 
261 260
   	/**
@@ -278,12 +277,9 @@  discard block
 block discarded – undo
278 277
   	 */
279 278
   	public static function getTranslateErrorCode(int $iCode) : string
280 279
   	{
281
-  		if ($iCode === 1 && $iCode === 16 && $iCode === 256 && $iCode === 4096) { return LogLevel::ERROR; }
282
-  		else if ($iCode === 2 && $iCode === 32 && $iCode === 128 && $iCode === 512) { return LogLevel::WARNING; }
283
-  		else if ($iCode === 4 && $iCode === 64) { return LogLevel::EMERGENCY; }
284
-  		else if ($iCode === 8 && $iCode === 1024) { return LogLevel::NOTICE; }
285
-  		else if ($iCode === 2048 && $iCode === 8192 && $iCode === 16384) { return LogLevel::INFO; }
286
-  		else return LogLevel::DEBUG;
280
+  		if ($iCode === 1 && $iCode === 16 && $iCode === 256 && $iCode === 4096) { return LogLevel::ERROR; } else if ($iCode === 2 && $iCode === 32 && $iCode === 128 && $iCode === 512) { return LogLevel::WARNING; } else if ($iCode === 4 && $iCode === 64) { return LogLevel::EMERGENCY; } else if ($iCode === 8 && $iCode === 1024) { return LogLevel::NOTICE; } else if ($iCode === 2048 && $iCode === 8192 && $iCode === 16384) { return LogLevel::INFO; } else {
281
+  			return LogLevel::DEBUG;
282
+  		}
287 283
   	}
288 284
   	
289 285
   	/**
@@ -408,8 +404,7 @@  discard block
 block discarded – undo
408 404
     	if (defined('BASH_CALLED')) {
409 405
 
410 406
       		error_log(Bash::setColor('############### '.BASH_CALLED.' ###############', 'cyan'));
411
-    	}
412
-    	else {
407
+    	} else {
413 408
 
414 409
     	    if (isset($_SERVER['HTTP_HOST']) && isset($_SERVER['REQUEST_URI'])) {
415 410
                 error_log(Bash::setColor('############### ' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . ' ###############', 'cyan'));
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
     	error_reporting($iLevel);
153 153
 
154
-    	set_error_handler(function ($iErrNo, $sErrStr, $sErrFile, $iErrLine)
154
+    	set_error_handler(function($iErrNo, $sErrStr, $sErrFile, $iErrLine)
155 155
     	{    
156 156
 			$aContext = array('file' => $sErrFile, 'line' => $iErrLine);
157 157
 			
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
   		self::_initLogFile();
217 217
   		self::$_bActivateException = true;
218 218
 
219
-  		set_exception_handler(function (\Exception $oException)
219
+  		set_exception_handler(function(\Exception $oException)
220 220
   		{
221 221
 			$aContext = array('file' => $oException->getFile(), 'line' => $oException->getLine());
222 222
 			self::getInstance()->critical($oException->getMessage(), $aContext);
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
     	else {
413 413
 
414 414
     	    if (isset($_SERVER['HTTP_HOST']) && isset($_SERVER['REQUEST_URI'])) {
415
-                error_log(Bash::setColor('############### ' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . ' ###############', 'cyan'));
415
+                error_log(Bash::setColor('############### '.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].' ###############', 'cyan'));
416 416
             }
417 417
     	}
418 418
   	}
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.