Code Duplication    Length = 6-6 lines in 2 locations

src/Client/Cosapi.php 2 locations

@@ 452-457 (lines=6) @@
449
        }
450
        $data['pattern'] = $pattern;
451
452
        if ($order != 0 && $order != 1) {
453
            return [
454
                'code'    => ErrorCode::COSAPI_PARAMS_ERROR,
455
                'message' => 'parameter order invalid',
456
            ];
457
        }
458
        $data['order'] = $order;
459
460
        if ($num < 0 || $num > 199) {
@@ 460-465 (lines=6) @@
457
        }
458
        $data['order'] = $order;
459
460
        if ($num < 0 || $num > 199) {
461
            return [
462
                'code'    => ErrorCode::COSAPI_PARAMS_ERROR,
463
                'message' => 'parameter num invalid, num need less then 200',
464
            ];
465
        }
466
        $data['num'] = $num;
467
468
        if (isset($context)) {