Completed
Push — master ( 8760fe...a207da )
by Hao
06:39 queued 03:50
created

Markdown   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 23
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getBody() 0 3 1
A bodyFields() 0 3 1
A validate() 0 4 1
1
<?php
2
3
namespace DingRobot\Message;
4
5
/**
6
 * Markdown
7
 *
8
 * @method Markdown title($title)
9
 * @method Markdown text($markdownText)
10
 *
11
 * @package DingRobot\Message
12
 */
13
class Markdown extends Base
14
{
15 1
    public function __construct($title = '')
16
    {
17 1
        parent::__construct();
18 1
        $this->title($title);
19 1
        $this->bodyName      = 'markdown';
20 1
    }
21
22 1
    protected function getBody()
23
    {
24 1
        return $this->body;
25
    }
26
27 1
    protected function bodyFields()
28
    {
29 1
        return ['title', 'text'];
30
    }
31
32 1
    protected function validate()
33
    {
34 1
        $this->check('title');
35 1
        $this->check('text');
36
    }
37
}