@@ -30,11 +30,11 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $this->config = $config; |
| 32 | 32 | $this->shop_id = $shop_id; |
| 33 | - if (! isset($config['app_key']) || ! $config['app_key']) { |
|
| 33 | + if (!isset($config['app_key']) || !$config['app_key']) { |
|
| 34 | 34 | throw new \InvalidArgumentException('配置有误, 请填写app_key'); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - if (! isset($config['app_secret']) || ! $config['app_secret']) { |
|
| 37 | + if (!isset($config['app_secret']) || !$config['app_secret']) { |
|
| 38 | 38 | throw new \InvalidArgumentException('配置有误, 请填写app_secret'); |
| 39 | 39 | } |
| 40 | 40 | $this->client = new Client(); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | private function getAccessToken(): string |
| 138 | 138 | { |
| 139 | 139 | $oauthToken = Cache::get(self::OAUTH_CACHE_KEY.$this->shop_id, []); |
| 140 | - if (! $oauthToken || ! $oauthToken['refresh_token']) { |
|
| 140 | + if (!$oauthToken || !$oauthToken['refresh_token']) { |
|
| 141 | 141 | return $this->requestAccessToken(); |
| 142 | 142 | } |
| 143 | 143 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | $response = $this->httpGet('oauth2/access_token', $param, false); |
| 172 | - if (! $response || $response['code'] > 10000) { |
|
| 172 | + if (!$response || $response['code'] > 10000) { |
|
| 173 | 173 | trigger_error("oauth2/access_token接口异常[{$response['code']}]"); |
| 174 | 174 | } |
| 175 | 175 | $response['data']['access_token_expired_at'] = time() + $response['data']['expires_in']; |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | ]; |
| 201 | 201 | |
| 202 | 202 | $response = $this->httpGet('oauth2/refresh_token', $param, false); |
| 203 | - if (! $response || $response['code'] > 10000) { |
|
| 203 | + if (!$response || $response['code'] > 10000) { |
|
| 204 | 204 | trigger_error("oauth2/access_token接口异常[{$response['code']}]"); |
| 205 | 205 | } |
| 206 | 206 | $response['data']['access_token_expired_at'] = time() + $response['data']['expires_in']; |