Test Failed
Pull Request — master (#1663)
by
unknown
06:11 queued 02:04
created

CardClient   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 30
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A set() 0 3 1
A get() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the overtrue/wechat.
5
 *
6
 * (c) overtrue <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace EasyWeChat\OfficialAccount\WiFi;
13
14
use EasyWeChat\Kernel\BaseClient;
15
16
/**
17
 * Class CardClient.
18
 *
19
 * @author her-cat <[email protected]>
20
 */
21
class CardClient extends BaseClient
22
{
23
    /**
24
     * Set shop card coupon delivery information.
25
     *
26
     * @param array $data
27
     *
28
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
29
     *
30
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
31
     * @throws \GuzzleHttp\Exception\GuzzleException
32
     */
33
    public function set(array $data)
34
    {
35
        return $this->httpPostJson('bizwifi/couponput/set', $data);
36
    }
37
38
    /**
39
     * Get shop card coupon delivery information.
40
     *
41
     * @param int $shopId
42
     *
43
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
44
     *
45
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
46
     * @throws \GuzzleHttp\Exception\GuzzleException
47
     */
48
    public function get(int $shopId = 0)
49
    {
50
        return $this->httpPostJson('bizwifi/couponput/get', ['shop_id' => $shopId]);
51
    }
52
}
53