@@ -20,10 +20,10 @@ |
||
| 20 | 20 | { |
| 21 | 21 | $requestor = new ApiRequest(); |
| 22 | 22 | $response = $requestor->request( |
| 23 | - 'post', |
|
| 24 | - Constant::API_ENDPOINTS['customer_profile'], |
|
| 25 | - $param, |
|
| 26 | - Constant::YES |
|
| 23 | + 'post', |
|
| 24 | + Constant::API_ENDPOINTS['customer_profile'], |
|
| 25 | + $param, |
|
| 26 | + Constant::YES |
|
| 27 | 27 | ); |
| 28 | 28 | return $response[0]; |
| 29 | 29 | } |
@@ -108,18 +108,18 @@ |
||
| 108 | 108 | */ |
| 109 | 109 | public static function getAuthToken() |
| 110 | 110 | { |
| 111 | - if(self::$authToken == null || gettype(self::$authToken) != "string"){ |
|
| 112 | - (array) $token = self::setAuthToken(); |
|
| 111 | + if (self::$authToken == null || gettype(self::$authToken) != "string") { |
|
| 112 | + (array) $token = self::setAuthToken(); |
|
| 113 | 113 | |
| 114 | 114 | $tokenBody = $token->body; |
| 115 | - if(array_key_exists('access_token',$tokenBody)){ |
|
| 116 | - self::$authTokenEnv = array_key_exists('environment',$tokenBody) ? $tokenBody['environment'] :null; |
|
| 117 | - self::$authToken = array_key_exists('access_token',$tokenBody) ? $tokenBody['access_token'] :null; |
|
| 118 | - }else{ |
|
| 115 | + if (array_key_exists('access_token', $tokenBody)) { |
|
| 116 | + self::$authTokenEnv = array_key_exists('environment', $tokenBody) ? $tokenBody['environment'] : null; |
|
| 117 | + self::$authToken = array_key_exists('access_token', $tokenBody) ? $tokenBody['access_token'] : null; |
|
| 118 | + } else { |
|
| 119 | 119 | return $token; |
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | - if(self::$appEnv == self::$authTokenEnv) |
|
| 122 | + if (self::$appEnv == self::$authTokenEnv) |
|
| 123 | 123 | return self::$authToken; |
| 124 | 124 | else |
| 125 | 125 | throw new Exception\UnexpectedValueException('Selected environment keys are invalid'); |
@@ -115,14 +115,15 @@ |
||
| 115 | 115 | if(array_key_exists('access_token',$tokenBody)){ |
| 116 | 116 | self::$authTokenEnv = array_key_exists('environment',$tokenBody) ? $tokenBody['environment'] :null; |
| 117 | 117 | self::$authToken = array_key_exists('access_token',$tokenBody) ? $tokenBody['access_token'] :null; |
| 118 | - }else{ |
|
| 118 | + } else{ |
|
| 119 | 119 | return $token; |
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | - if(self::$appEnv == self::$authTokenEnv) |
|
| 123 | - return self::$authToken; |
|
| 124 | - else |
|
| 125 | - throw new Exception\UnexpectedValueException('Selected environment keys are invalid'); |
|
| 122 | + if(self::$appEnv == self::$authTokenEnv) { |
|
| 123 | + return self::$authToken; |
|
| 124 | + } else { |
|
| 125 | + throw new Exception\UnexpectedValueException('Selected environment keys are invalid'); |
|
| 126 | + } |
|
| 126 | 127 | } |
| 127 | 128 | |
| 128 | 129 | /** |