Code Duplication    Length = 14-14 lines in 6 locations

app/Support/Tencent/XgPush/XingeApp.php 6 locations

@@ 531-544 (lines=14) @@
528
    /**
529
     * 查询标签下token数量
530
     */
531
    public function QueryTagTokenNum($tag)
532
    {
533
        $ret = array('ret_code' => -1);
534
        if (!is_string($tag)) {
535
            $ret['err_msg'] = 'tag is not valid';
536
            return $ret;
537
        }
538
        $params = array();
539
        $params['access_id'] = $this->accessId;
540
        $params['tag'] = $tag;
541
        $params['timestamp'] = time();
542
543
        return $this->callRestful(self::RESTAPI_QUERYTAGTOKENNUM, $params);
544
    }
545
546
    /**
547
     * 查询token的标签
@@ 549-562 (lines=14) @@
546
    /**
547
     * 查询token的标签
548
     */
549
    public function QueryTokenTags($deviceToken)
550
    {
551
        $ret = array('ret_code' => -1);
552
        if (!is_string($deviceToken)) {
553
            $ret['err_msg'] = 'deviceToken is not valid';
554
            return $ret;
555
        }
556
        $params = array();
557
        $params['access_id'] = $this->accessId;
558
        $params['device_token'] = $deviceToken;
559
        $params['timestamp'] = time();
560
561
        return $this->callRestful(self::RESTAPI_QUERYTOKENTAGS, $params);
562
    }
563
564
    /**
565
     * 取消定时发送
@@ 567-580 (lines=14) @@
564
    /**
565
     * 取消定时发送
566
     */
567
    public function CancelTimingPush($pushId)
568
    {
569
        $ret = array('ret_code' => -1);
570
        if (!is_string($pushId) || empty($pushId)) {
571
            $ret['err_msg'] = 'pushId not valid';
572
            return $ret;
573
        }
574
        $params = array();
575
        $params['access_id'] = $this->accessId;
576
        $params['push_id'] = $pushId;
577
        $params['timestamp'] = time();
578
579
        return $this->callRestful(self::RESTAPI_CANCELTIMINGPUSH, $params);
580
    }
581
582
    //json转换为数组
583
    protected function json2Array($json)
@@ 670-683 (lines=14) @@
667
        return $this->callRestful(self::RESTAPI_BATCHDELTAG, $params);
668
    }
669
670
    public function QueryInfoOfToken($deviceToken)
671
    {
672
        $ret = array('ret_code' => -1);
673
        if (!is_string($deviceToken)) {
674
            $ret['err_msg'] = 'deviceToken is not valid';
675
            return $ret;
676
        }
677
        $params = array();
678
        $params['access_id'] = $this->accessId;
679
        $params['device_token'] = $deviceToken;
680
        $params['timestamp'] = time();
681
682
        return $this->callRestful(self::RESTAPI_QUERYINFOOFTOKEN, $params);
683
    }
684
685
    public function QueryTokensOfAccount($account)
686
    {
@@ 685-698 (lines=14) @@
682
        return $this->callRestful(self::RESTAPI_QUERYINFOOFTOKEN, $params);
683
    }
684
685
    public function QueryTokensOfAccount($account)
686
    {
687
        $ret = array('ret_code' => -1);
688
        if (!is_string($account)) {
689
            $ret['err_msg'] = 'account is not valid';
690
            return $ret;
691
        }
692
        $params = array();
693
        $params['access_id'] = $this->accessId;
694
        $params['account'] = $account;
695
        $params['timestamp'] = time();
696
697
        return $this->callRestful(self::RESTAPI_QUERYTOKENSOFACCOUNT, $params);
698
    }
699
700
    public function DeleteTokenOfAccount($account, $deviceToken)
701
    {
@@ 716-729 (lines=14) @@
713
        return $this->callRestful(self::RESTAPI_DELETETOKENOFACCOUNT, $params);
714
    }
715
716
    public function DeleteAllTokensOfAccount($account)
717
    {
718
        $ret = array('ret_code' => -1);
719
        if (!is_string($account)) {
720
            $ret['err_msg'] = 'account is not valid';
721
            return $ret;
722
        }
723
        $params = array();
724
        $params['access_id'] = $this->accessId;
725
        $params['account'] = $account;
726
        $params['timestamp'] = time();
727
728
        return $this->callRestful(self::RESTAPI_DELETEALLTOKENSOFACCOUNT, $params);
729
    }
730
731
    private function ValidateMessageType($message)
732
    {