These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Toplan\PhpSms; |
||
4 | |||
5 | class FooAgent extends Agent |
||
6 | { |
||
7 | //override |
||
8 | //发送短信一级入口 |
||
9 | public function sendSms($tempId, $to, array $tempData, $content) |
||
10 | { |
||
11 | //在这个方法中调用二级入口 |
||
12 | //根据你使用的服务商的接口选择调用哪个方式发送短信 |
||
13 | $this->sendContentSms($to, $content); |
||
14 | $this->sendTemplateSms($tempId, $to, $tempData); |
||
15 | } |
||
16 | |||
17 | //override |
||
18 | //发送短信二级入口:发送内容短信 |
||
19 | public function sendContentSms($to, $content) |
||
20 | { |
||
21 | //获取配置文件中的参数 |
||
22 | //$x = $this->x; |
||
0 ignored issues
–
show
|
|||
23 | |||
24 | //内置方法: |
||
25 | // Agent::sockPost(); |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
58% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
|||
26 | // Agent::curl(); |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
58% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
|||
27 | |||
28 | //切记更新发送结果 |
||
29 | $this->result(Agent::SUCCESS, true);//是否发送成功 |
||
30 | $this->result(Agent::INFO, 'info');//发送结果信息说明 |
||
31 | $this->result(Agent::CODE, 'code');//发送结果代码 |
||
32 | } |
||
33 | |||
34 | //override |
||
35 | //发送短信二级入口:发送模板短信 |
||
36 | public function sendTemplateSms($tempId, $to, array $tempData) |
||
37 | { |
||
38 | //同上... |
||
39 | } |
||
40 | |||
41 | //override |
||
42 | //发送语音验证码入口 |
||
43 | public function voiceVerify($to, $code) |
||
44 | { |
||
45 | //同上... |
||
46 | } |
||
47 | } |
||
48 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.