@@ -219,13 +219,13 @@ |
||
| 219 | 219 | * Force Logout of SugarAPI Object |
| 220 | 220 | */ |
| 221 | 221 | public function logout(){ |
| 222 | - if (!empty($this->authToken)){ |
|
| 223 | - $response = $this->oauth2Logout()->execute()->getResponse(); |
|
| 224 | - if ($response->getStatus()=='200'){ |
|
| 225 | - unset($this->authToken); |
|
| 226 | - unset($this->authExpiration); |
|
| 227 | - } |
|
| 228 | - } |
|
| 222 | + if (!empty($this->authToken)){ |
|
| 223 | + $response = $this->oauth2Logout()->execute()->getResponse(); |
|
| 224 | + if ($response->getStatus()=='200'){ |
|
| 225 | + unset($this->authToken); |
|
| 226 | + unset($this->authExpiration); |
|
| 227 | + } |
|
| 228 | + } |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | /** |
@@ -84,9 +84,9 @@ discard block |
||
| 84 | 84 | * Configure the static property $_DEFAULTS with settings from defaults.php |
| 85 | 85 | */ |
| 86 | 86 | protected function loadDefaults(){ |
| 87 | - if (empty(static::$_DEFAULTS)) { |
|
| 88 | - include __DIR__ . DIRECTORY_SEPARATOR . 'defaults.php'; |
|
| 89 | - if (isset($defaults)) { |
|
| 87 | + if (empty(static::$_DEFAULTS)){ |
|
| 88 | + include __DIR__.DIRECTORY_SEPARATOR.'defaults.php'; |
|
| 89 | + if (isset($defaults)){ |
|
| 90 | 90 | static::$_DEFAULTS = $defaults; |
| 91 | 91 | } |
| 92 | 92 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $response = $this->oauth2Token()->data($this->authOptions)->execute()->getResponse(); |
| 177 | 177 | if ($response->getStatus()=='200'){ |
| 178 | 178 | $this->setAuthToken($response->getBody()); |
| 179 | - } else{ |
|
| 179 | + }else{ |
|
| 180 | 180 | throw new AuthenticationException($response->getBody()); |
| 181 | 181 | } |
| 182 | 182 | } |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $response = $this->oauth2Refresh()->data($refreshOptions)->execute()->getResponse(); |
| 203 | 203 | if ($response->getStatus()=='200'){ |
| 204 | 204 | $this->setAuthToken($response->getBody()); |
| 205 | - } else{ |
|
| 205 | + }else{ |
|
| 206 | 206 | throw new AuthenticationException($response->getBody()); |
| 207 | 207 | } |
| 208 | 208 | } |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | * @return bool |
| 213 | 213 | */ |
| 214 | 214 | public function authExpired(){ |
| 215 | - return time() >= $this->authExpiration; |
|
| 215 | + return time()>=$this->authExpiration; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /** |