Passed
Push — master ( 99bfc0...d990ad )
by ma
19:38
created
src/Gateways/Naver.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
             }
81 81
             $this->token['token_type'] = 'Bearer';
82 82
             $this->token['access_token'] = $_REQUEST['access_token'];
83
-        }else {
83
+        } else {
84 84
             $this->getToken();
85 85
         }
86 86
         $data = $this->call('nid/me', $this->token, 'GET');
Please login to merge, or discard this patch.
src/Gateways/Sina.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@
 block discarded – undo
94 94
             }
95 95
             $this->token['access_token'] = $_REQUEST['access_token'];
96 96
             $this->token['openid'] = $_REQUEST['uid'];
97
-        }else{
97
+        } else{
98 98
             /** 获取参数 */
99 99
             $params = $this->accessTokenParams();
100 100
             $this->AccessTokenURL = $this->AccessTokenURL. '?' . http_build_query($params);//get传参
Please login to merge, or discard this patch.
src/Helper/ConstCode.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,18 +52,18 @@
 block discarded – undo
52 52
             case self::TYPE_QQ:
53 53
                 if($type == 'app'){
54 54
                     $typeConst = self::TYPE_QQ_APP;//qqApp
55
-                }else{
55
+                } else{
56 56
                     $typeConst = $channel;
57 57
                 }
58 58
                 break;
59 59
             case self::TYPE_WECHAT:
60 60
                 if($type == 'app'){
61 61
                     $typeConst = self::TYPE_WECHAT_APP;//微信App
62
-                }else if($type == 'applets'){
62
+                } else if($type == 'applets'){
63 63
                     $typeConst =  self::TYPE_WECHAT_APPLETS;//微信小程序
64
-                }else if(Tool::isWeiXin()){
64
+                } else if(Tool::isWeiXin()){
65 65
                     $typeConst =  self::TYPE_WECHAT_MOBILE;//微信mobile
66
-                }else{
66
+                } else{
67 67
                     $typeConst = $channel;
68 68
                 }
69 69
                 break;
Please login to merge, or discard this patch.
example/proxy/wx_proxy.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
             if($_GET['scope'] == 'snsapi_login'){
34 34
                 //扫码登录
35 35
                 $AuthorizeURL = $this->AuthorizeURL . '/connect/qrconnect';
36
-            }else{
36
+            } else{
37 37
                 $AuthorizeURL = $this->AuthorizeURL . '/connect/oauth2/authorize';
38 38
             }
39 39
 
Please login to merge, or discard this patch.
example/oauth2.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
         if($name == 'wechat'){
43 43
             if(!Tool::isMobile()){
44 44
                 $this->config = $this->config['pc'];//微信pc扫码登录
45
-            }elseif(Tool::isWeiXin()){
45
+            } elseif(Tool::isWeiXin()){
46 46
                 $this->config = $this->config['mobile'];//微信浏览器中打开
47
-            }else{
47
+            } else{
48 48
                 echo '请使用微信打开!';exit();//手机浏览器打开
49 49
             }
50 50
         }
@@ -59,7 +59,9 @@  discard block
 block discarded – undo
59 59
      */
60 60
     public function login($name,$state=""){
61 61
         /** 获取配置 */
62
-        if($name == 'wx') $name = 'wechat';
62
+        if($name == 'wx') {
63
+            $name = 'wechat';
64
+        }
63 65
         $this->getConfig($name);
64 66
         $this->config['state'] = $state;
65 67
 
@@ -94,7 +96,9 @@  discard block
 block discarded – undo
94 96
     public function callback($name)
95 97
     {
96 98
         /** 获取配置 */
97
-        if($name == 'wx') $name = 'wechat';
99
+        if($name == 'wx') {
100
+            $name = 'wechat';
101
+        }
98 102
         $this->getConfig($name);
99 103
 
100 104
         /** 初始化实例类 */
Please login to merge, or discard this patch.
src/Gateways/Douyin.php 1 patch
Braces   +10 added lines, -6 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
              * https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/account-permission/douyin-default-get-permission-code
76 76
              */
77 77
             return $this->AuthorizeSilenceURL . '?' . http_build_query($params);
78
-        }else{
78
+        } else{
79 79
             return $this->AuthorizeURL . '?' . http_build_query($params);
80 80
         }
81 81
     }
@@ -138,10 +138,10 @@  discard block
 block discarded – undo
138 138
                 throw new OAuthException("Douyin APP登录 需要传输access_token参数! ");
139 139
             }
140 140
             $this->token['access_token'] = $_REQUEST['access_token'];
141
-        }elseif ($this->type == 'applets'){
141
+        } elseif ($this->type == 'applets'){
142 142
             //小程序
143 143
             return $this->applets();
144
-        }else {
144
+        } else {
145 145
             /** 获取token信息 */
146 146
             $this->getToken();
147 147
         }
@@ -218,8 +218,12 @@  discard block
 block discarded – undo
218 218
             'appid'      => $this->config['app_id'],
219 219
             'secret'     => $this->config['app_secret'],
220 220
         ];
221
-        if(isset($_REQUEST['code'])) $params['code'] = $_REQUEST['code'];
222
-        if(isset($_REQUEST['anonymous_code'])) $params['anonymous_code'] = $_REQUEST['anonymous_code'];
221
+        if(isset($_REQUEST['code'])) {
222
+            $params['code'] = $_REQUEST['code'];
223
+        }
224
+        if(isset($_REQUEST['anonymous_code'])) {
225
+            $params['anonymous_code'] = $_REQUEST['anonymous_code'];
226
+        }
223 227
 
224 228
         return $params;
225 229
     }
@@ -237,7 +241,7 @@  discard block
 block discarded – undo
237 241
         $data = json_decode($token, true);
238 242
         if (isset($data['data']['access_token'])) {
239 243
             return $data['data'];
240
-        }elseif (isset($data['session_key'])){
244
+        } elseif (isset($data['session_key'])){
241 245
             //小程序登录
242 246
             return $data;
243 247
         } else {
Please login to merge, or discard this patch.
src/Gateways/Qq.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@
 block discarded – undo
117 117
                 throw new OAuthException("腾讯QQ,APP登录 需要传输access_token参数! ");
118 118
             }
119 119
             $this->token['access_token'] = $_REQUEST['access_token'];
120
-        }else{
120
+        } else{
121 121
             /** 获取token */
122 122
             $this->getToken();
123 123
         }
Please login to merge, or discard this patch.
src/Gateways/Alipay.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@
 block discarded – undo
142 142
                 throw new OAuthException("AliPay APP登录 需要传输access_token参数! ");
143 143
             }
144 144
             $this->token['access_token'] = $_REQUEST['access_token'];
145
-        }else {
145
+        } else {
146 146
             /** 获取token信息 */
147 147
             $this->getToken();
148 148
         }
Please login to merge, or discard this patch.
src/Gateways/Wechat.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
                 throw new OAuthException("Wechat APP登录 需要传输access_token参数! ");
136 136
             }
137 137
             $this->token['access_token'] = $_REQUEST['access_token'];
138
-        }elseif ($this->type == 'applets'){
138
+        } elseif ($this->type == 'applets'){
139 139
             //小程序
140 140
             return $this->applets();
141
-        }else {
141
+        } else {
142 142
             /** 获取token信息 */
143 143
             $this->getToken();
144 144
         }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         $data = json_decode($token, true);
220 220
         if (isset($data['access_token'])) {
221 221
             return $data;
222
-        }elseif (isset($data['session_key'])){
222
+        } elseif (isset($data['session_key'])){
223 223
             //小程序登录
224 224
             return $data;
225 225
         } else {
Please login to merge, or discard this patch.