Video::media()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace EntWeChat\Message;
4
5
/**
6
 * Class Video.
7
 *
8
 * @property string $title
9
 * @property string $media_id
10
 * @property string $description
11
 * @property string $thumb_media_id
12
 */
13
class Video extends AbstractMessage
14
{
15
    /**
16
     * Message type.
17
     *
18
     * @var string
19
     */
20
    protected $type = 'video';
21
22
    /**
23
     * Properties.
24
     *
25
     * @var array
26
     */
27
    protected $properties = [
28
        'title',
29
        'description',
30
        'media_id',
31
        'thumb_media_id',
32
    ];
33
34
    /**
35
     * 设置视频消息.
36
     *
37
     * @param string $mediaId
38
     *
39
     * @return Video
40
     */
41
    public function media($mediaId)
42
    {
43
        $this->setAttribute('media_id', $mediaId);
44
45
        return $this;
46
    }
47
48
    /**
49
     * 设置视频封面.
50
     *
51
     * @param string $mediaId
52
     *
53
     * @return Video
54
     */
55
    public function thumb($mediaId)
56
    {
57
        $this->setAttribute('thumb_media_id', $mediaId);
58
59
        return $this;
60
    }
61
}
62