Merchant   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 44
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
1
<?php
2
3
namespace EntWeChat\Payment;
4
5
use EntWeChat\Support\Attribute;
6
7
/**
8
 * Class Merchant.
9
 *
10
 * @property string $app_id
11
 * @property string $merchant_id
12
 * @property string $key
13
 * @property string $sub_app_id
14
 * @property string $sub_merchant_id
15
 * @property string $ssl_cert_path
16
 * @property string $ssl_key_path
17
 * @property string $fee_type
18
 * @property string $device_info
19
 */
20
class Merchant extends Attribute
21
{
22
    /**
23
     * @var array
24
     */
25
    protected $attributes = [
26
        'app_id',
27
        'merchant_id',
28
        'key',
29
        'sub_app_id',
30
        'sub_merchant_id',
31
        'ssl_cert_path',
32
        'ssl_key_path',
33
        'fee_type',
34
        'device_info',
35
    ];
36
37
    /**
38
     * Aliases of attributes.
39
     *
40
     * @var array
41
     */
42
    protected $aliases = [
43
        'app_id'          => 'appid',
44
        'key'             => 'mch_key',
45
        'merchant_id'     => 'mch_id',
46
        'sub_app_id'      => 'sub_appid',
47
        'sub_merchant_id' => 'sub_mch_id',
48
        'cert_path'       => 'sslcert_path',
49
        'key_path'        => 'sslkey_path',
50
    ];
51
52
    /**
53
     * Constructor.
54
     *
55
     * @param array $attributes
56
     */
57
    public function __construct(array $attributes)
58
    {
59
        parent::__construct($attributes);
60
61
        $this->with('fee_type', 'CNY');
62
    }
63
}
64