Code Duplication    Length = 4-4 lines in 4 locations

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

@@ 214-217 (lines=4) @@
211
    public function PushSingleAccount($deviceType, $account, $message, $environment = 0)
212
    {
213
        $ret = ['ret_code' => -1];
214
        if (! is_int($deviceType) || $deviceType < 0 || $deviceType > 5) {
215
            $ret['err_msg'] = 'deviceType not valid';
216
217
            return $ret;
218
        }
219
        if (! is_string($account) || empty($account)) {
220
            $ret['err_msg'] = 'account not valid';
@@ 269-272 (lines=4) @@
266
    public function PushAccountList($deviceType, $accountList, $message, $environment = 0)
267
    {
268
        $ret = ['ret_code' => -1];
269
        if (! is_int($deviceType) || $deviceType < 0 || $deviceType > 5) {
270
            $ret['err_msg'] = 'deviceType not valid';
271
272
            return $ret;
273
        }
274
        if (! is_array($accountList) || empty($accountList)) {
275
            $ret['err_msg'] = 'accountList not valid';
@@ 323-326 (lines=4) @@
320
    public function PushAllDevices($deviceType, $message, $environment = 0)
321
    {
322
        $ret = ['ret_code' => -1, 'err_msg' => 'message not valid'];
323
        if (! is_int($deviceType) || $deviceType < 0 || $deviceType > 5) {
324
            $ret['err_msg'] = 'deviceType not valid';
325
326
            return $ret;
327
        }
328
329
        if (! ($message instanceof Message) && ! ($message instanceof MessageIOS)) {
@@ 378-381 (lines=4) @@
375
    public function PushTags($deviceType, $tagList, $tagsOp, $message, $environment = 0)
376
    {
377
        $ret = ['ret_code' => -1, 'err_msg' => 'message not valid'];
378
        if (! is_int($deviceType) || $deviceType < 0 || $deviceType > 5) {
379
            $ret['err_msg'] = 'deviceType not valid';
380
381
            return $ret;
382
        }
383
        if (! is_array($tagList) || empty($tagList)) {
384
            $ret['err_msg'] = 'tagList not valid';