Completed
Pull Request — master (#33)
by
unknown
01:51
created
src/Providers/CorpWeChatProvider.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -65,6 +65,7 @@
 block discarded – undo
65 65
 
66 66
     /**
67 67
      * {@inheritdoc}.
68
+     * @param string $state
68 69
      */
69 70
     protected function buildAuthUrlFromBase($url, $state)
70 71
     {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -144,12 +144,12 @@  discard block
 block discarded – undo
144 144
         //参数列表: 
145 145
         // https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=id&corpsecret=secrect
146 146
 
147
-        if(!$code){
147
+        if (!$code) {
148 148
             $token_fields = [
149 149
                 'corpid' => $this->clientId,
150 150
                 'corpsecret' => $this->clientSecret,
151 151
             ];    
152
-        }else{
152
+        } else {
153 153
             $token_fields = [
154 154
                 'access_token'=>$this->config['longlive_access_token'],
155 155
                 'code'=>$code,
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     {
168 168
 
169 169
         //没有指定则自己获取
170
-        if(!$this->config['longlive_access_token']){
170
+        if (!$this->config['longlive_access_token']) {
171 171
             $this->config['longlive_access_token'] = $this->getLongiveAccessToken();
172 172
         }
173 173
         $param = $this->getTokenFields($code);
@@ -178,15 +178,15 @@  discard block
 block discarded – undo
178 178
         ]);
179 179
 
180 180
         $content = $response->getBody()->getContents();
181
-        $content = json_decode($content,true);
182
-        $content['access_token'] =  $this->config['longlive_access_token'];
181
+        $content = json_decode($content, true);
182
+        $content['access_token'] = $this->config['longlive_access_token'];
183 183
 
184 184
         $token = $this->parseAccessToken($content);
185 185
         return $token;
186 186
 
187 187
     }
188 188
     // !!应该尽量不要调用, 除非 单独与overture/wechat使用, 否则同时获取accesstoken, 会冲突
189
-    public function getLongiveAccessToken($forse_refresh = false){
189
+    public function getLongiveAccessToken($forse_refresh = false) {
190 190
         $get_token_url = $this->getTokenUrl();
191 191
         $response = $this->getHttpClient()->get($get_token_url, [
192 192
             'query' => $this->getTokenFields(),
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@
 block discarded – undo
149 149
                 'corpid' => $this->clientId,
150 150
                 'corpsecret' => $this->clientSecret,
151 151
             ];    
152
-        }else{
152
+        } else{
153 153
             $token_fields = [
154 154
                 'access_token'=>$this->config['longlive_access_token'],
155 155
                 'code'=>$code,
Please login to merge, or discard this patch.