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

Text   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A toXmlArray() 0 6 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 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