Client   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

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
     * @throws \GuzzleHttp\Exception\GuzzleException
32
     */
33 1
    public function registerMiniProgram(array $params)
34
    {
35 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...
36
    }
37
38
    /**
39
     * 查询创建任务状态.
40
     *
41
     * @param string $companyName
42
     * @param string $legalPersonaWechat
43
     * @param string $legalPersonaName
44
     *
45
     * @return array
46
     *
47
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
48
     * @throws \GuzzleHttp\Exception\GuzzleException
49
     */
50 1
    public function getRegistrationStatus(string $companyName, string $legalPersonaWechat, string $legalPersonaName)
51
    {
52
        $params = [
53 1
            'name' => $companyName,
54 1
            'legal_persona_wechat' => $legalPersonaWechat,
55 1
            'legal_persona_name' => $legalPersonaName,
56
        ];
57
58 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...
59
    }
60
}
61