Code Duplication    Length = 14-14 lines in 2 locations

src/phpsms/agents/YunPianAgent.php 2 locations

@@ 17-30 (lines=14) @@
14
        'Content-Type:application/x-www-form-urlencoded;charset=utf-8',
15
    ];
16
17
    public function sendContentSms($to, $content)
18
    {
19
        $url = 'https://sms.yunpian.com/v1/sms/send.json';
20
        $params = $this->params([
21
            'apikey' => $this->apikey,
22
            'mobile' => $to,
23
            'text'   => $content,
24
        ]);
25
        $result = $this->curlPost($url, [], [
26
            CURLOPT_HTTPHEADER => $this->headers,
27
            CURLOPT_POSTFIELDS => http_build_query($params),
28
        ]);
29
        $this->setResult($result);
30
    }
31
32
    public function sendVoiceCode($to, $code)
33
    {
@@ 32-45 (lines=14) @@
29
        $this->setResult($result);
30
    }
31
32
    public function sendVoiceCode($to, $code)
33
    {
34
        $url = 'https://voice.yunpian.com/v1/voice/send.json';
35
        $params = $this->params([
36
            'apikey' => $this->apikey,
37
            'mobile' => $to,
38
            'code'   => $code,
39
        ]);
40
        $result = $this->curlPost($url, [], [
41
            CURLOPT_HTTPHEADER => $this->headers,
42
            CURLOPT_POSTFIELDS => http_build_query($params),
43
        ]);
44
        $this->setResult($result);
45
    }
46
47
    protected function setResult($result)
48
    {