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

Client   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 36
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRegistrationStatus() 0 9 1
A registerMiniProgram() 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\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