Passed
Push — master ( 6f56e6...99469e )
by Md. Julfiker
04:39
created
src/manager/CsrfManager.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -89,8 +89,9 @@  discard block
 block discarded – undo
89 89
      */
90 90
     public function generateToken() {
91 91
         $sesId = session_id();
92
-        if (!$sesId)
93
-           $sesId = session_id("UN_AUTHORIZED");
92
+        if (!$sesId) {
93
+                   $sesId = session_id("UN_AUTHORIZED");
94
+        }
94 95
 
95 96
         $this->CSRFToken = md5($sesId+self::SLAT+time());
96 97
         $minutes = $this->tokenValidInMinutes;
@@ -108,8 +109,9 @@  discard block
 block discarded – undo
108 109
      * @return string
109 110
      */
110 111
     public function getStorageToken() {
111
-        if ($this->session->get(self::SESSION_STORE_TOKEN_NAME) && $this->_isNotExpiredAt())
112
-            return $this->session->get(self::SESSION_STORE_TOKEN_NAME);
112
+        if ($this->session->get(self::SESSION_STORE_TOKEN_NAME) && $this->_isNotExpiredAt()) {
113
+                    return $this->session->get(self::SESSION_STORE_TOKEN_NAME);
114
+        }
113 115
 
114 116
         return false;
115 117
     }
@@ -127,8 +129,9 @@  discard block
 block discarded – undo
127 129
      * @return string
128 130
      */
129 131
     public function getCSRFToken() {
130
-        if (!$this->session->has(self::SESSION_STORE_TOKEN_NAME) || $this->_isTokenExpired())
131
-        $this->refreshToken();
132
+        if (!$this->session->has(self::SESSION_STORE_TOKEN_NAME) || $this->_isTokenExpired()) {
133
+                $this->refreshToken();
134
+        }
132 135
 
133 136
        return $this->session->get(self::SESSION_STORE_TOKEN_NAME);
134 137
     }
Please login to merge, or discard this patch.