Completed
Push — master ( 989005...ce143f )
by Camilo
04:43
created

VideoNote   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 42
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A mapSubObjects() 0 9 2
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace unreal4u\TelegramAPI\Telegram\Types;
6
7
use unreal4u\TelegramAPI\Abstracts\TelegramTypes;
8
9
/**
10
 * This object represents a video message (available in Telegram apps as of v.4.0).
11
 *
12
 * Objects defined as-is May 2017
13
 *
14
 * @see https://core.telegram.org/bots/api#videonote
15
 */
16
class VideoNote extends TelegramTypes
17
{
18
    /**
19
     * Unique identifier for this file
20
     * @var string
21
     */
22
    public $file_id = '';
23
24
    /**
25
     * Video width and height as defined by sender
26
     * @var int
27
     */
28
    public $length = 0;
29
30
    /**
31
     * Duration of the video in seconds as defined by sender
32
     * @var int
33
     */
34
    public $duration = 0;
35
36
    /**
37
     * Optional. Video thumbnail
38
     * @var PhotoSize
39
     */
40
    public $thumb;
41
42
    /**
43
     * Optional. File size
44
     * @var int
45
     */
46
    public $file_size = 0;
47
48
    protected function mapSubObjects(string $key, array $data): TelegramTypes
49
    {
50
        switch ($key) {
51
            case 'thumb':
52
                return new PhotoSize($data, $this->logger);
53
        }
54
55
        return parent::mapSubObjects($key, $data);
56
    }
57
}
58