Completed
Pull Request — master (#1556)
by wannanbigpig
06:50
created

Client::setSettlementCard()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 1
dl 0
loc 11
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\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
     */
35
    public function setSettlementCard($params)
36
    {
37
        $params['sub_mch_id'] = $params['sub_mch_id'] ?? $this->app['config']->sub_mch_id;
38
        $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...
39
            'version' => '1.0',
40
            'cert_sn' => '',
41
            'sign_type' => 'HMAC-SHA256',
42
            'nonce_str' => uniqid('micro'),
43
        ]));
44
45
        return $this->safeRequest('applyment/micro/modifyarchives', $params);
46
    }
47
48
    /**
49
     * update contact info.
50
     *
51
     * @param $params
52
     *
53
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
54
     *
55
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
56
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
57
     * @throws \EasyWeChat\MicroMerchant\Kernel\Exceptions\EncryptException
58
     */
59
    public function updateContact($params)
60
    {
61
        $params['sub_mch_id'] = $params['sub_mch_id'] ?? $this->app['config']->sub_mch_id;
62
        $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...
63
            'version' => '1.0',
64
            'cert_sn' => '',
65
            'sign_type' => 'HMAC-SHA256',
66
            'nonce_str' => uniqid('micro'),
67
        ]));
68
69
        return $this->safeRequest('applyment/micro/modifycontactinfo', $params);
70
    }
71
}
72