@@ -39,8 +39,7 @@ discard block |
||
| 39 | 39 | if (isset($parsedCookie)) { |
| 40 | 40 | $parsedCookie = json_decode($parsedCookie, true); |
| 41 | 41 | $this->validateCookie($parsedCookie); |
| 42 | - } |
|
| 43 | - else { |
|
| 42 | + } else { |
|
| 44 | 43 | if ($callMode !== ProxyAux::MODE_LOGIN) { |
| 45 | 44 | throw new CookieExpiredException(); |
| 46 | 45 | } |
@@ -56,8 +55,7 @@ discard block |
||
| 56 | 55 | public function createCookie(Array $content) { |
| 57 | 56 | if (!isset($this->info[CookieManager::COOKIE_TIME]) || $this->info[CookieManager::COOKIE_TIME] == null) { |
| 58 | 57 | $cookie = Cookie::forever($this->info[CookieManager::COOKIE_NAME], json_encode($content)); |
| 59 | - } |
|
| 60 | - else { |
|
| 58 | + } else { |
|
| 61 | 59 | $cookie = Cookie::make($this->info[CookieManager::COOKIE_NAME], json_encode($content), $this->info[CookieManager::COOKIE_TIME]); |
| 62 | 60 | } |
| 63 | 61 | |
@@ -68,8 +68,7 @@ discard block |
||
| 68 | 68 | if ($proxyResponse->getStatusCode() != 200) { |
| 69 | 69 | if (array_key_exists(ProxyAux::REFRESH_TOKEN, $parsedCookie)) { |
| 70 | 70 | $ret = $this->tryRefreshToken($inputs, $parsedCookie); |
| 71 | - } |
|
| 72 | - else { |
|
| 71 | + } else { |
|
| 73 | 72 | $cookie = $this->cookieManager->destroyCookie(); |
| 74 | 73 | } |
| 75 | 74 | } |
@@ -111,8 +110,7 @@ discard block |
||
| 111 | 110 | |
| 112 | 111 | //Set a new cookie with updated access token and refresh token |
| 113 | 112 | $cookie = $this->cookieManager->createCookie($parsedCookie); |
| 114 | - } |
|
| 115 | - else { |
|
| 113 | + } else { |
|
| 116 | 114 | $cookie = $this->cookieManager->destroyCookie(); |
| 117 | 115 | } |
| 118 | 116 | |
@@ -169,8 +167,7 @@ discard block |
||
| 169 | 167 | |
| 170 | 168 | if ($method === 'GET') { |
| 171 | 169 | $options = array_add($options, 'query', $inputs); |
| 172 | - } |
|
| 173 | - else { |
|
| 170 | + } else { |
|
| 174 | 171 | $options = array_add($options, 'body', $inputs); |
| 175 | 172 | } |
| 176 | 173 | |
@@ -178,8 +175,7 @@ discard block |
||
| 178 | 175 | |
| 179 | 176 | try { |
| 180 | 177 | $response = $client->send($request); |
| 181 | - } |
|
| 182 | - catch (ClientException $ex) { |
|
| 178 | + } catch (ClientException $ex) { |
|
| 183 | 179 | $response = $ex->getResponse(); |
| 184 | 180 | } |
| 185 | 181 | |
@@ -200,8 +196,7 @@ discard block |
||
| 200 | 196 | } |
| 201 | 197 | $info['id'] = $clientId; |
| 202 | 198 | $info['secret'] = $this->clientSecrets[$clientId]; |
| 203 | - } |
|
| 204 | - else if (count($this->clientSecrets) >= 1) { |
|
| 199 | + } else if (count($this->clientSecrets) >= 1) { |
|
| 205 | 200 | $firstKey = key($this->clientSecrets); |
| 206 | 201 | $info['id'] = $firstKey; |
| 207 | 202 | $info['secret'] = $this->clientSecrets[$firstKey]; |
@@ -95,8 +95,7 @@ |
||
| 95 | 95 | if ($grantType === ProxyAux::PASSWORD_GRANT) { |
| 96 | 96 | $mode = ProxyAux::MODE_LOGIN; |
| 97 | 97 | } |
| 98 | - } |
|
| 99 | - else if (isset($skip) && strtolower($skip) === 'true') { |
|
| 98 | + } else if (isset($skip) && strtolower($skip) === 'true') { |
|
| 100 | 99 | $mode = ProxyAux::MODE_SKIP; |
| 101 | 100 | } |
| 102 | 101 | |