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

Text::toXmlArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
ccs 0
cts 6
cp 0
crap 2
rs 9.4285
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 Text.
16
 *
17
 * @property string $content
18
 */
19
class Text extends Message
20
{
21
    /**
22
     * Message type.
23
     *
24
     * @var string
25
     */
26
    protected $type = 'text';
27
28
    /**
29
     * Properties.
30
     *
31
     * @var array
32
     */
33
    protected $properties = ['content'];
34
35
    /**
36
     * Text constructor.
37
     *
38
     * @param string $content
39
     */
40
    public function __construct(string $content)
41
    {
42
        parent::__construct(compact('content'));
43
    }
44
45
    /**
46
     * @return array
47
     */
48
    public function toXmlArray()
49
    {
50
        return [
51
            'Content' => $this->get('content'),
52
        ];
53
    }
54
}
55