Passed
Push — master ( a2a2c3...5dc036 )
by Carlos
03:01
created

Transfer   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 39
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
A toXmlArray() 0 8 2
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\Kernel\Messages;
13
14
/**
15
 * Class Transfer.
16
 *
17
 * @property string $to
18
 * @property string $account
19
 */
20
class Transfer extends Message
21
{
22
    /**
23
     * Messages type.
24
     *
25
     * @var string
26
     */
27
    protected $type = 'transfer_customer_service';
28
29
    /**
30
     * Properties.
31
     *
32
     * @var array
33
     */
34
    protected $properties = [
35
        'account',
36
    ];
37
38
    /**
39
     * Transfer constructor.
40
     *
41
     * @param string|null $account
42
     */
43
    public function __construct(string $account = null)
44
    {
45
        if (!is_null($account)) {
46
            $this->account = $account;
47
        }
48
    }
49
50
    public function toXmlArray()
51
    {
52
        return empty($this->get('account')) ? [] : [
53
            'TransInfo' => [
54
                'KfAccount' => $this->get('account'),
55
            ],
56
        ];
57
    }
58
}
59