Completed
Pull Request — master (#1556)
by wannanbigpig
04:17
created

Client   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 54
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A updateArchives() 0 11 1
A updateContact() 0 11 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\MicroMerchant\Material;
13
14
use EasyWeChat\MicroMerchant\Kernel\BaseClient;
15
16
/**
17
 * Class Client.
18
 *
19
 * @author   liuml  <[email protected]>
20
 * @DateTime 2019-05-30  14:19
21
 */
22
class Client extends BaseClient
23
{
24
    /**
25
     * update settlement card.
26
     *
27
     * @param $params
28
     *
29
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
30
     *
31
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
32
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
33
     * @throws \EasyWeChat\MicroMerchant\Kernel\Exceptions\EncryptException
34
     * @throws \EasyWeChat\MicroMerchant\Kernel\Exceptions\InvalidExtensionException
35
     * @throws \EasyWeChat\MicroMerchant\Kernel\Exceptions\InvalidSignException
36
     * @throws \Psr\SimpleCache\InvalidArgumentException
37
     */
38
    public function updateArchives($params)
39
    {
40
        $params['sub_mch_id'] = $params['sub_mch_id'] ?? $this->app['config']->sub_mch_id;
41
        $params = $this->processParams(array_merge($params, [
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 15 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
42
            'version' => '1.0',
43
            'cert_sn' => '',
44
            'sign_type' => 'HMAC-SHA256',
45
            'nonce_str' => uniqid('micro'),
46
        ]));
47
48
        return $this->safeRequest('applyment/micro/modifyarchives', $params);
49
    }
50
51
    /**
52
     * update contact info.
53
     *
54
     * @param $params
55
     *
56
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
57
     *
58
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
59
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
60
     * @throws \EasyWeChat\MicroMerchant\Kernel\Exceptions\EncryptException
61
     * @throws \EasyWeChat\MicroMerchant\Kernel\Exceptions\InvalidExtensionException
62
     * @throws \EasyWeChat\MicroMerchant\Kernel\Exceptions\InvalidSignException
63
     * @throws \Psr\SimpleCache\InvalidArgumentException
64
     */
65
    public function updateContact($params)
66
    {
67
        $params['sub_mch_id'] = $params['sub_mch_id'] ?? $this->app['config']->sub_mch_id;
68
        $params = $this->processParams(array_merge($params, [
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 15 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
69
            'version' => '1.0',
70
            'cert_sn' => '',
71
            'sign_type' => 'HMAC-SHA256',
72
            'nonce_str' => uniqid('micro'),
73
        ]));
74
75
        return $this->safeRequest('applyment/micro/modifycontactinfo', $params);
76
    }
77
}
78