Code Duplication    Length = 14-14 lines in 6 locations

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

@@ 591-604 (lines=14) @@
588
    /**
589
     * 查询标签下token数量.
590
     */
591
    public function QueryTagTokenNum($tag)
592
    {
593
        $ret = ['ret_code' => -1];
594
        if (! is_string($tag)) {
595
            $ret['err_msg'] = 'tag is not valid';
596
597
            return $ret;
598
        }
599
        $params = [];
600
        $params['access_id'] = $this->accessId;
601
        $params['tag'] = $tag;
602
        $params['timestamp'] = time();
603
604
        return $this->callRestful(self::RESTAPI_QUERYTAGTOKENNUM, $params);
605
    }
606
607
    /**
@@ 610-623 (lines=14) @@
607
    /**
608
     * 查询token的标签.
609
     */
610
    public function QueryTokenTags($deviceToken)
611
    {
612
        $ret = ['ret_code' => -1];
613
        if (! is_string($deviceToken)) {
614
            $ret['err_msg'] = 'deviceToken is not valid';
615
616
            return $ret;
617
        }
618
        $params = [];
619
        $params['access_id'] = $this->accessId;
620
        $params['device_token'] = $deviceToken;
621
        $params['timestamp'] = time();
622
623
        return $this->callRestful(self::RESTAPI_QUERYTOKENTAGS, $params);
624
    }
625
626
    /**
@@ 629-642 (lines=14) @@
626
    /**
627
     * 取消定时发送
628
     */
629
    public function CancelTimingPush($pushId)
630
    {
631
        $ret = ['ret_code' => -1];
632
        if (! is_string($pushId) || empty($pushId)) {
633
            $ret['err_msg'] = 'pushId not valid';
634
635
            return $ret;
636
        }
637
        $params = [];
638
        $params['access_id'] = $this->accessId;
639
        $params['push_id'] = $pushId;
640
        $params['timestamp'] = time();
641
642
        return $this->callRestful(self::RESTAPI_CANCELTIMINGPUSH, $params);
643
    }
644
645
    //json转换为数组
@@ 737-750 (lines=14) @@
734
        return $this->callRestful(self::RESTAPI_BATCHDELTAG, $params);
735
    }
736
737
    public function QueryInfoOfToken($deviceToken)
738
    {
739
        $ret = ['ret_code' => -1];
740
        if (! is_string($deviceToken)) {
741
            $ret['err_msg'] = 'deviceToken is not valid';
742
743
            return $ret;
744
        }
745
        $params = [];
746
        $params['access_id'] = $this->accessId;
747
        $params['device_token'] = $deviceToken;
748
        $params['timestamp'] = time();
749
750
        return $this->callRestful(self::RESTAPI_QUERYINFOOFTOKEN, $params);
751
    }
752
753
    public function QueryTokensOfAccount($account)
@@ 753-766 (lines=14) @@
750
        return $this->callRestful(self::RESTAPI_QUERYINFOOFTOKEN, $params);
751
    }
752
753
    public function QueryTokensOfAccount($account)
754
    {
755
        $ret = ['ret_code' => -1];
756
        if (! is_string($account)) {
757
            $ret['err_msg'] = 'account is not valid';
758
759
            return $ret;
760
        }
761
        $params = [];
762
        $params['access_id'] = $this->accessId;
763
        $params['account'] = $account;
764
        $params['timestamp'] = time();
765
766
        return $this->callRestful(self::RESTAPI_QUERYTOKENSOFACCOUNT, $params);
767
    }
768
769
    public function DeleteTokenOfAccount($account, $deviceToken)
@@ 786-799 (lines=14) @@
783
        return $this->callRestful(self::RESTAPI_DELETETOKENOFACCOUNT, $params);
784
    }
785
786
    public function DeleteAllTokensOfAccount($account)
787
    {
788
        $ret = ['ret_code' => -1];
789
        if (! is_string($account)) {
790
            $ret['err_msg'] = 'account is not valid';
791
792
            return $ret;
793
        }
794
        $params = [];
795
        $params['access_id'] = $this->accessId;
796
        $params['account'] = $account;
797
        $params['timestamp'] = time();
798
799
        return $this->callRestful(self::RESTAPI_DELETEALLTOKENSOFACCOUNT, $params);
800
    }
801
802
    private function ValidateMessageType($message)