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 getDepositedCount($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 getCode($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 getUserCards($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 getCard($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 setPayCell($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
     * 修改库存接口.
@@ 541-550 (lines=10) @@
538
     *
539
     * @return array
540
     */
541
    public function updateCode($code, $newCode, $cardId = [])
542
    {
543
        $params = [
544
            'code' => $code,
545
            'new_code' => $newCode,
546
            'card_id' => $cardId,
547
        ];
548
549
        return $this->parseJSON('json', [self::API_CODE_UPDATE, $params]);
550
    }
551
552
    /**
553
     * 删除卡券接口.
@@ 559-566 (lines=8) @@
556
     *
557
     * @return array
558
     */
559
    public function delete($cardId)
560
    {
561
        $params = [
562
            'card_id' => $cardId,
563
        ];
564
565
        return $this->parseJSON('json', [self::API_CARD_DELETE, $params]);
566
    }
567
568
    /**
569
     * 设置卡券失效.
@@ 576-584 (lines=9) @@
573
     *
574
     * @return array
575
     */
576
    public function disable($code, $cardId = '')
577
    {
578
        $params = [
579
            'code' => $code,
580
            'card_id' => $cardId,
581
        ];
582
583
        return $this->parseJSON('json', [self::API_UNAVAILABLE, $params]);
584
    }
585
586
    /**
587
     * 会员卡接口激活.
@@ 625-633 (lines=9) @@
622
     *
623
     * @return array
624
     */
625
    public function getMemberCardUser($cardId, $code)
626
    {
627
        $params = [
628
            'card_id' => $cardId,
629
            'code' => $code,
630
        ];
631
632
        return $this->parseJSON('json', [self::API_MEMBER_USER_INFO, $params]);
633
    }
634
635
    /**
636
     * 更新会员信息.