Markdown   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 19
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getBody() 0 3 1
A bodyFields() 0 5 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 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
}