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

FeedCard::validate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 0
dl 0
loc 2
ccs 1
cts 1
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace DingRobot\Message;
4
5
use DingRobot\Message\Traits\Link as TraitLink;
6
7
/**
8
 * FeedCard
9
 *
10
 * @package DingRobot\Message
11
 */
12
class FeedCard extends Base
13
{
14
    use TraitLink;
15
16 3
    public function __construct($links = null)
17
    {
18 3
        parent::__construct();
19 3
        $this->bodyName = 'feedCard';
20 3
        if ($links) {
21 2
            $this->body['links'] = $links;
22
        }
23 3
    }
24
25 1
    protected function getBody()
26
    {
27 1
        $this->body['links'] = array_merge($this->links, $this->body['links']);
28 1
        foreach ($this->body['links'] as $link) {
29 1
            $this->validateLink($link);
30
        }
31 1
        return $this->body;
32
    }
33
34 2
    protected function bodyFields()
35
    {
36 2
        return [];
37
    }
38
}