Code Duplication    Length = 9-10 lines in 2 locations

src/phpsms/agents/YunPianAgent.php 2 locations

@@ 17-26 (lines=10) @@
14
        $this->sendContentSms($to, $content);
15
    }
16
17
    public function sendContentSms($to, $content)
18
    {
19
        $url = 'http://yunpian.com/v1/sms/send.json';
20
        $apikey = $this->apikey;
21
        $content = urlencode("$content");
22
        $postString = "apikey=$apikey&text=$content&mobile=$to";
23
        $response = $this->sockPost($url, $postString);
24
        $data = json_decode($response, true);
25
        $this->setResult($data);
26
    }
27
28
    public function voiceVerify($to, $code, $tempId, array $data)
29
    {
@@ 28-36 (lines=9) @@
25
        $this->setResult($data);
26
    }
27
28
    public function voiceVerify($to, $code, $tempId, array $data)
29
    {
30
        $url = 'http://voice.yunpian.com/v1/voice/send.json';
31
        $apikey = $this->apikey;
32
        $postString = "apikey=$apikey&code=$code&mobile=$to";
33
        $response = $this->sockPost($url, $postString);
34
        $data = json_decode($response, true);
35
        $this->setResult($data);
36
    }
37
38
    protected function setResult($result)
39
    {