Completed
Pull Request — master (#15)
by Helpful
02:08
created
code/HybridSessionStore.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
         $hash = hash_hmac('sha256', $enc, $this->saltedKey);
101 101
 
102
-        return base64_encode($iv.$hash.$enc);
102
+        return base64_encode($iv . $hash . $enc);
103 103
     }
104 104
 
105 105
     /**
@@ -171,8 +171,8 @@  discard block
 block discarded – undo
171 171
     protected function getLifetime()
172 172
     {
173 173
         $params = session_get_cookie_params();
174
-        $cookieLifetime = (int)$params['lifetime'];
175
-        $gcLifetime = (int)ini_get('session.gc_maxlifetime');
174
+        $cookieLifetime = (int) $params['lifetime'];
175
+        $gcLifetime = (int) ini_get('session.gc_maxlifetime');
176 176
         return $cookieLifetime ? min($cookieLifetime, $gcLifetime) : $gcLifetime;
177 177
     }
178 178
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
      */
184 184
     protected function getNow()
185 185
     {
186
-        return (int)SS_Datetime::now()->Format('U');
186
+        return (int) SS_Datetime::now()->Format('U');
187 187
     }
188 188
 }
189 189
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
     public function open($save_path, $name)
241 241
     {
242
-        $this->cookie = $name.'_2';
242
+        $this->cookie = $name . '_2';
243 243
         // Read the incoming value, then clear the cookie - we might not be able
244 244
         // to do so later if write() is called after headers are sent
245 245
         // This is intended to force a failover to the database store if the
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 
288 288
         // Verify expiration
289 289
         if ($cookieData) {
290
-            $expiry = (int)substr($cookieData, 0, 10);
290
+            $expiry = (int) substr($cookieData, 0, 10);
291 291
             $data = substr($cookieData, 10);
292 292
 
293 293
             if ($expiry > $this->getNow()) {
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
         );
329 329
 
330 330
         // Respect auto-expire on browser close for the session cookie (in case the cookie lifetime is zero)
331
-        $cookieLifetime = min((int)$params['lifetime'], $lifetime);
331
+        $cookieLifetime = min((int) $params['lifetime'], $lifetime);
332 332
         Cookie::set(
333 333
             $this->cookie,
334 334
             $this->currentCookieData,
Please login to merge, or discard this patch.