Code Duplication    Length = 4-4 lines in 4 locations

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

@@ 199-202 (lines=4) @@
196
    public function PushSingleAccount($deviceType, $account, $message, $environment = 0)
197
    {
198
        $ret = array('ret_code' => -1);
199
        if (!is_int($deviceType) || $deviceType < 0 || $deviceType > 5) {
200
            $ret['err_msg'] = 'deviceType not valid';
201
            return $ret;
202
        }
203
        if (!is_string($account) || empty($account)) {
204
            $ret['err_msg'] = 'account not valid';
205
            return $ret;
@@ 247-250 (lines=4) @@
244
    public function PushAccountList($deviceType, $accountList, $message, $environment = 0)
245
    {
246
        $ret = array('ret_code' => -1);
247
        if (!is_int($deviceType) || $deviceType < 0 || $deviceType > 5) {
248
            $ret['err_msg'] = 'deviceType not valid';
249
            return $ret;
250
        }
251
        if (!is_array($accountList) || empty($accountList)) {
252
            $ret['err_msg'] = 'accountList not valid';
253
            return $ret;
@@ 294-297 (lines=4) @@
291
    public function PushAllDevices($deviceType, $message, $environment = 0)
292
    {
293
        $ret = array('ret_code' => -1, 'err_msg' => 'message not valid');
294
        if (!is_int($deviceType) || $deviceType < 0 || $deviceType > 5) {
295
            $ret['err_msg'] = 'deviceType not valid';
296
            return $ret;
297
        }
298
299
        if (!($message instanceof Message) && !($message instanceof MessageIOS)) return $ret;
300
        if (!$this->ValidateMessageType($message)) {
@@ 340-343 (lines=4) @@
337
    public function PushTags($deviceType, $tagList, $tagsOp, $message, $environment = 0)
338
    {
339
        $ret = array('ret_code' => -1, 'err_msg' => 'message not valid');
340
        if (!is_int($deviceType) || $deviceType < 0 || $deviceType > 5) {
341
            $ret['err_msg'] = 'deviceType not valid';
342
            return $ret;
343
        }
344
        if (!is_array($tagList) || empty($tagList)) {
345
            $ret['err_msg'] = 'tagList not valid';
346
            return $ret;