for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Dongdavid\Notify;
use Dongdavid\Notify\utils\Http;
// 如果没有cache方法就自定义一个方法用redis做缓存
if (!function_exists('getAccessToken')) {
function getAccessToken($type,$appId,$appSecret,$agentid = 0)
$agentid
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
function getAccessToken($type,$appId,$appSecret,/** @scrutinizer ignore-unused */ $agentid = 0)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
{
switch ($type){
case 'wechatoffical':
$url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$appId}&secret={$appSecret}";
break;
case 'miniprogram':
default:
return '类型错误';
}
echo $url;
$res = Http::get($url);
if (isset($res['access_token'])){
return $res;
}else{
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.