Passed
Push — master ( 371c27...e17cde )
by Hao
04:51
created

Markdown::validate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
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
        return [
30 1
            'title' => ['required' => true, 'type' => 'string'],
31
            'text'  => ['required' => true, 'type' => 'string']
32
        ];
33
    }
34
}