Passed
Push — master ( d3d615...bd27f9 )
by mingyoung
03:00
created

Client   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 41
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getAvailableList() 0 5 1
A get() 0 3 1
A update() 0 5 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\OpenPlatform\Authorizer\MiniProgram\SubscribeComponent;
13
14
use EasyWeChat\Kernel\BaseClient;
15
16
/**
17
 * Class Client.
18
 *
19
 * @author joyeekk <[email protected]>
20
 */
21
class Client extends BaseClient
22
{
23
    /**
24
     * 获取展示的公众号信息.
25
     *
26
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
27
     */
28 1
    public function get()
29
    {
30 1
        return $this->httpGet('wxa/getshowwxaitem');
31
    }
32
33
    /**
34
     * 设置展示的公众号.
35
     *
36
     * @param string $appid
37
     * @param int    $flag
38
     *
39
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
40
     */
41 1
    public function update(string $appid, int $flag)
42
    {
43 1
        return $this->httpPostJson('wxa/updateshowwxaitem', [
44 1
            'appid' => $appid,
45 1
            'wxa_subscribe_biz_flag' => $flag,
46
        ]);
47
    }
48
49
    /**
50
     * 获取可以用来设置的公众号列表.
51
     *
52
     * @param int $page
53
     * @param int $num
54
     *
55
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
56
     */
57 1
    public function getAvailableList(int $page, int $num)
58
    {
59 1
        return $this->httpGet('wxa/getwxamplinkforshow', [
60 1
            'page' => $page,
61 1
            'num' => $num,
62
        ]);
63
    }
64
}
65