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

Client::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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