Code Duplication    Length = 12-12 lines in 2 locations

src/phpsms/agents/QcloudAgent.php 2 locations

@@ 19-30 (lines=12) @@
16
    protected $sendVoicePrompt = 'https://yun.tim.qq.com/v5/tlsvoicesvr/sendvoiceprompt';
17
    protected $random;
18
19
    public function sendContentSms($to, $content)
20
    {
21
        $params = [
22
            'type'   => 0, // 0:普通短信 1:营销短信
23
            'msg'    => $content,
24
            'tel'    => $to,
25
            'time'   => time(),
26
        ];
27
        $this->random = $this->getRandom();
28
        $sendUrl = "{$this->sendSms}?sdkappid={$this->appId}&random={$this->random}";
29
        $this->request($sendUrl, $params);
30
    }
31
32
    public function sendTemplateSms($to, $tempId, array $data)
33
    {
@@ 32-43 (lines=12) @@
29
        $this->request($sendUrl, $params);
30
    }
31
32
    public function sendTemplateSms($to, $tempId, array $data)
33
    {
34
        $params = [
35
            'tel'    => $to,
36
            'tpl_id' => $tempId,
37
            'params' => array_values($data),
38
            'time'   => time(),
39
        ];
40
        $this->random = $this->getRandom();
41
        $sendUrl = "{$this->sendSms}?sdkappid={$this->appId}&random={$this->random}";
42
        $this->request($sendUrl, $params);
43
    }
44
45
    public function sendVoiceCode($to, $code)
46
    {