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

Markdown::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
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
}