Completed
Push — master ( 28cde6...a92b36 )
by Carlos
03:57
created

Client::getRegistrationStatus()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 3
dl 0
loc 9
ccs 5
cts 5
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\Component;
13
14
use EasyWeChat\Kernel\BaseClient;
15
16
/**
17
 * Class Client.
18
 *
19
 * @author dudashuang <[email protected]>
20
 */
21
class Client extends BaseClient
22
{
23
    /**
24
     * 通过法人微信快速创建小程序.
25
     *
26
     * @param array $params
27
     *
28
     * @return array
29
     *
30
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
31
     */
32 1
    public function registerMiniProgram(array $params)
33
    {
34 1
        return $this->httpPostJson('cgi-bin/component/fastregisterweapp', $params, ['action' => 'create']);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->httpPostJs...('action' => 'create')) returns the type EasyWeChat\Kernel\Support\Collection which is incompatible with the documented return type array.
Loading history...
35
    }
36
37
    /**
38
     * 查询创建任务状态.
39
     *
40
     * @param string $companyName
41
     * @param string $legalPersonaWechat
42
     * @param string $legalPersonaName
43
     *
44
     * @return array
45
     *
46
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
47
     */
48 1
    public function getRegistrationStatus(string $companyName, string $legalPersonaWechat, string $legalPersonaName)
49
    {
50
        $params = [
51 1
            'name' => $companyName,
52 1
            'legal_persona_wechat' => $legalPersonaWechat,
53 1
            'legal_persona_name' => $legalPersonaName,
54
        ];
55
56 1
        return $this->httpPostJson('cgi-bin/component/fastregisterweapp', $params, ['action' => 'search']);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->httpPostJs...('action' => 'search')) returns the type EasyWeChat\Kernel\Support\Collection which is incompatible with the documented return type array.
Loading history...
57
    }
58
}
59