Conditions | 4 |
Paths | 5 |
Total Lines | 18 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | function getAccessToken($type,$appId,$appSecret,$agentid = 0) |
||
|
|||
10 | { |
||
11 | switch ($type){ |
||
12 | case 'wechatoffical': |
||
13 | $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$appId}&secret={$appSecret}"; |
||
14 | break; |
||
15 | case 'miniprogram': |
||
16 | $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$appId}&secret={$appSecret}"; |
||
17 | break; |
||
18 | default: |
||
19 | return '类型错误'; |
||
20 | } |
||
21 | echo $url; |
||
22 | $res = Http::get($url); |
||
23 | if (isset($res['access_token'])){ |
||
24 | return $res; |
||
25 | }else{ |
||
26 | return $res; |
||
27 | } |
||
32 | } |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.