InputMediaVideo   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 146
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 9
eloc 30
c 2
b 0
f 0
dl 0
loc 146
ccs 0
cts 50
cp 0
rs 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A getWidth() 0 3 1
A __construct() 0 17 1
A setDuration() 0 3 1
A setHeight() 0 3 1
A setWidth() 0 3 1
A getDuration() 0 3 1
A setSupportsStreaming() 0 3 1
A getSupportsStreaming() 0 3 1
A getHeight() 0 3 1
1
<?php
2
3
namespace TelegramBot\Api\Types\InputMedia;
4
5
/**
6
 * Class InputMediaVideo
7
 * Represents a video to be sent.
8
 *
9
 * @package TelegramBot\Api
10
 */
11
class InputMediaVideo extends InputMedia
12
{
13
    /**
14
     * {@inheritdoc}
15
     *
16
     * @var array
17
     */
18
    protected static $map = [
19
        'type' => true,
20
        'media' => true,
21
        'caption' => true,
22
        'parse_mode' => true,
23
        'width' => true,
24
        'height' => true,
25
        'duration' => true,
26
        'supports_streaming' => true
27
    ];
28
29
    /**
30
     * Optional. Video width.
31
     *
32
     * @var int|null
33
     */
34
    protected $width;
35
36
    /**
37
     * Optional. Video height.
38
     *
39
     * @var int|null
40
     */
41
    protected $height;
42
43
    /**
44
     * Optional. Video duration.
45
     *
46
     * @var int|null
47
     */
48
    protected $duration;
49
50
    /**
51
     * Optional. Pass True, if the uploaded video is suitable for streaming.
52
     *
53
     * @var bool|null
54
     */
55
    protected $supportsStreaming;
56
57
    /**
58
     * InputMediaVideo constructor.
59
     *
60
     * @param string $media
61
     * @param string|null $caption
62
     * @param string|null $parseMode
63
     * @param int|null $width
64
     * @param int|null $height
65
     * @param int|null $duration
66
     * @param bool $supportsStreaming
67
     */
68
    public function __construct(
69
        $media,
70
        $caption = null,
71
        $parseMode = null,
72
        $width = null,
73
        $height = null,
74
        $duration = null,
75
        $supportsStreaming = false
76
    ) {
77
        $this->type = 'video';
78
        $this->media = $media;
79
        $this->caption = $caption;
80
        $this->parseMode = $parseMode;
81
        $this->width = $width;
82
        $this->height = $height;
83
        $this->duration = $duration;
84
        $this->supportsStreaming = $supportsStreaming;
85
    }
86
87
    /**
88
     * @return int|null
89
     */
90
    public function getWidth()
91
    {
92
        return $this->width;
93
    }
94
95
    /**
96
     * @param int|null $width
97
     *
98
     * @return void
99
     */
100
    public function setWidth($width)
101
    {
102
        $this->width = $width;
103
    }
104
105
    /**
106
     * @return int|null
107
     */
108
    public function getHeight()
109
    {
110
        return $this->height;
111
    }
112
113
    /**
114
     * @param int|null $height
115
     *
116
     * @return void
117
     */
118
    public function setHeight($height)
119
    {
120
        $this->height = $height;
121
    }
122
123
    /**
124
     * @return int|null
125
     */
126
    public function getDuration()
127
    {
128
        return $this->duration;
129
    }
130
131
    /**
132
     * @param int|null $duration
133
     *
134
     * @return void
135
     */
136
    public function setDuration($duration)
137
    {
138
        $this->duration = $duration;
139
    }
140
141
    /**
142
     * @return bool|null
143
     */
144
    public function getSupportsStreaming()
145
    {
146
        return $this->supportsStreaming;
147
    }
148
149
    /**
150
     * @param bool|null $supportsStreaming
151
     *
152
     * @return void
153
     */
154
    public function setSupportsStreaming($supportsStreaming)
155
    {
156
        $this->supportsStreaming = $supportsStreaming;
157
    }
158
}
159