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

DeviceText::toXmlArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 9
ccs 0
cts 9
cp 0
crap 2
rs 9.6666
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\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