Completed
Push — master ( e9be36...9488e8 )
by Camilo
04:57
created

Video   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 1
c 3
b 0
f 0
lcom 0
cbo 1
dl 0
loc 51
ccs 2
cts 2
cp 1
rs 10
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace unreal4u\TelegramAPI\Telegram\Types;
6
7
use unreal4u\TelegramAPI\Abstracts\TelegramTypes;
8
use unreal4u\TelegramAPI\Telegram\Types\Custom\PhotoSizeArray;
9
10
/**
11
 * This object represents a video file
12
 *
13
 * Objects defined as-is july 2016
14
 *
15
 * @see https://core.telegram.org/bots/api#video
16
 */
17
class Video extends TelegramTypes
18
{
19
    /**
20
     * Unique identifier for this file
21
     * @var string
22
     */
23
    public $file_id = '';
24
25
    /**
26
     * Video width as defined by sender
27
     * @var int
28
     */
29
    public $width = 0;
30
31
    /**
32
     * Video height as defined by sender
33
     * @var int
34
     */
35
    public $height = 0;
36
37
    /**
38
     * Duration of the video in seconds as defined by sender
39
     * @var int
40
     */
41
    public $duration = 0;
42
43
    /**
44
     * Optional. Video thumbnail
45
     * @var PhotoSize
46
     */
47
    public $thumb = null;
48
49
    /**
50
     * Optional. Mime type of a file as defined by sender
51
     * @var string
52
     */
53
    public $mime_type = '';
54
55
    /**
56
     * Optional. File size
57
     * @var int
58
     */
59
    public $file_size = 0;
60
61
    protected function mapSubObjects(string $key, array $data): TelegramTypes
62
    {
63
        switch ($key) {
64
            case 'thumb':
65
                return new PhotoSizeArray($data, $this->logger);
66
        }
67
68
        return parent::mapSubObjects($key, $data);
69
    }
70
}
71