Video   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 39
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A toXmlArray() 0 7 1
1
<?php
2
3
/*
4
 * This file is part of the overtrue/wechat.
5
 *
6
 * (c) overtrue <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace EasyWeChat\Kernel\Messages;
13
14
/**
15
 * Class Video.
16
 *
17
 * @property string $video
18
 * @property string $title
19
 * @property string $media_id
20
 * @property string $description
21
 * @property string $thumb_media_id
22
 */
23
class Video extends Media
24
{
25
    /**
26
     * Messages type.
27
     *
28
     * @var string
29
     */
30
    protected $type = 'video';
31
32
    /**
33
     * Properties.
34
     *
35
     * @var array
36
     */
37
    protected $properties = [
38
        'title',
39
        'description',
40
        'media_id',
41
        'thumb_media_id',
42
    ];
43
44
    /**
45
     * Video constructor.
46
     *
47
     * @param string $mediaId
48
     * @param array  $attributes
49
     */
50 1
    public function __construct(string $mediaId, array $attributes = [])
51
    {
52 1
        parent::__construct($mediaId, 'video', $attributes);
53 1
    }
54
55 1
    public function toXmlArray()
56
    {
57
        return [
58
            'Video' => [
59 1
                'MediaId' => $this->get('media_id'),
60 1
                'Title' => $this->get('title'),
61 1
                'Description' => $this->get('description'),
62
            ],
63
        ];
64
    }
65
}
66