Code Duplication    Length = 8-10 lines in 13 locations

src/Card/Card.php 13 locations

@@ 277-285 (lines=9) @@
274
     *
275
     * @return array
276
     */
277
    public function deposit($cardId, $code)
278
    {
279
        $params = [
280
            'card_id' => $cardId,
281
            'code' => $code,
282
        ];
283
284
        return $this->parseJSON('json', [self::API_DEPOSIT, $params]);
285
    }
286
287
    /**
288
     * 查询导入code数目.
@@ 294-301 (lines=8) @@
291
     *
292
     * @return array
293
     */
294
    public function getDepositCount($cardId)
295
    {
296
        $params = [
297
            'card_id' => $cardId,
298
        ];
299
300
        return $this->parseJSON('json', [self::API_GET_DEPOSIT_COUNT, $params]);
301
    }
302
303
    /**
304
     * 核查code接口.
@@ 311-319 (lines=9) @@
308
     *
309
     * @return array
310
     */
311
    public function checkCode($cardId, $code)
312
    {
313
        $params = [
314
            'card_id' => $cardId,
315
            'code' => $code,
316
        ];
317
318
        return $this->parseJSON('json', [self::API_CHECK_CODE, $params]);
319
    }
320
321
    /**
322
     * 图文消息群发卡券.
@@ 328-335 (lines=8) @@
325
     *
326
     * @return array
327
     */
328
    public function getHtml($cardId)
329
    {
330
        $params = [
331
            'card_id' => $cardId,
332
        ];
333
334
        return $this->parseJSON('json', [self::API_GET_HTML, $params]);
335
    }
336
337
    /**
338
     * 设置测试白名单.
@@ 364-373 (lines=10) @@
361
     *
362
     * @return array
363
     */
364
    public function codeGet($code, $checkConsume, $cardId)
365
    {
366
        $params = [
367
            'code' => $code,
368
            'check_consume' => $checkConsume,
369
            'card_id' => $cardId,
370
        ];
371
372
        return $this->parseJSON('json', [self::API_CODE_GET, $params]);
373
    }
374
375
    /**
376
     * 核销Code接口.
@@ 383-391 (lines=9) @@
380
     *
381
     * @return array
382
     */
383
    public function consume($cardId, $code)
384
    {
385
        $params = [
386
            'card_id' => $cardId,
387
            'code' => $code,
388
        ];
389
390
        return $this->parseJSON('json', [self::API_CONSUME, $params]);
391
    }
392
393
    /**
394
     * Code解码接口.
@@ 417-425 (lines=9) @@
414
     *
415
     * @return array
416
     */
417
    public function getCardList($openid, $cardId = '')
418
    {
419
        $params = [
420
            'openid' => $openid,
421
            'card_id' => $cardId,
422
        ];
423
424
        return $this->parseJSON('json', [self::API_GET_CARD_LIST, $params]);
425
    }
426
427
    /**
428
     * 查看卡券详情.
@@ 434-441 (lines=8) @@
431
     *
432
     * @return array
433
     */
434
    public function cardGet($cardId)
435
    {
436
        $params = [
437
            'card_id' => $cardId,
438
        ];
439
440
        return $this->parseJSON('json', [self::API_CARD_GET, $params]);
441
    }
442
443
    /**
444
     * 批量查询卡列表.
@@ 496-504 (lines=9) @@
493
     *
494
     * @return array
495
     */
496
    public function payCellSet($cardId, $isOpen = true)
497
    {
498
        $params = [
499
            'card_id' => $cardId,
500
            'is_open' => $isOpen,
501
        ];
502
503
        return $this->parseJSON('json', [self::API_PAY_CELL_SET, $params]);
504
    }
505
506
    /**
507
     * 修改库存接口.
@@ 539-548 (lines=10) @@
536
     *
537
     * @return array
538
     */
539
    public function codeUpdate($code, $newCode, $cardId = [])
540
    {
541
        $params = [
542
            'code' => $code,
543
            'new_code' => $newCode,
544
            'card_id' => $cardId,
545
        ];
546
547
        return $this->parseJSON('json', [self::API_CODE_UPDATE, $params]);
548
    }
549
550
    /**
551
     * 删除卡券接口.
@@ 557-564 (lines=8) @@
554
     *
555
     * @return array
556
     */
557
    public function cardDelete($cardId)
558
    {
559
        $params = [
560
            'card_id' => $cardId,
561
        ];
562
563
        return $this->parseJSON('json', [self::API_CARD_DELETE, $params]);
564
    }
565
566
    /**
567
     * 设置卡券失效.
@@ 574-582 (lines=9) @@
571
     *
572
     * @return array
573
     */
574
    public function unavailable($code, $cardId = null)
575
    {
576
        $params = [
577
            'code' => $code,
578
            'card_id' => $cardId,
579
        ];
580
581
        return $this->parseJSON('json', [self::API_UNAVAILABLE, $params]);
582
    }
583
584
    /**
585
     * 拉取卡券概况数据接口.
@@ 693-701 (lines=9) @@
690
     *
691
     * @return array
692
     */
693
    public function memberCardUserInfo($cardId, $code)
694
    {
695
        $params = [
696
            'card_id' => $cardId,
697
            'code' => $code,
698
        ];
699
700
        return $this->parseJSON('json', [self::API_MEMBER_USER_INFO, $params]);
701
    }
702
703
    /**
704
     * 更新会员信息.