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

DeviceText   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 32
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A toXmlArray() 0 9 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\Kernel\Messages;
13
14
/**
15
 * Class DeviceText.
16
 *
17
 * @property string $content
18
 */
19
class DeviceText extends Message
20
{
21
    /**
22
     * Messages type.
23
     *
24
     * @var string
25
     */
26
    protected $type = 'device_text';
27
28
    /**
29
     * Properties.
30
     *
31
     * @var array
32
     */
33
    protected $properties = [
34
        'device_type',
35
        'device_id',
36
        'content',
37
        'session_id',
38
        'open_id',
39
    ];
40
41
    public function toXmlArray()
42
    {
43
        return [
44
            'DeviceType' => $this->get('device_type'),
45
            'DeviceID' => $this->get('device_id'),
46
            'SessionID' => $this->get('session_id'),
47
            'Content' => base64_encode($this->get('content')),
48
        ];
49
    }
50
}
51