Markdown::__construct()   A
last analyzed

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 2
    public function __construct($title = '')
16
    {
17 2
        parent::__construct();
18 2
        $this->title($title);
19 2
        $this->bodyName = 'markdown';
20 2
    }
21
22 1
    protected function getBody()
23
    {
24 1
        return $this->body;
25
    }
26
27 2
    protected function bodyFields()
28
    {
29
        return [
30 2
            'title' => ['required' => true, 'type' => 'string'],
31
            'text'  => ['required' => true, 'type' => 'string']
32
        ];
33
    }
34
}