Passed
Push — master ( 6140a2...ff30ae )
by
unknown
09:50
created

InputMediaVideo::setDuration()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
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
    static protected $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 string
33
     */
34
    protected $width;
35
36
    /**
37
     * Optional. Video height.
38
     *
39
     * @var string
40
     */
41
    protected $height;
42
43
    /**
44
     * Optional. Video duration.
45
     *
46
     * @var string
47
     */
48
    protected $duration;
49
50
    /**
51
     * Optional. Pass True, if the uploaded video is suitable for streaming.
52
     *
53
     * @var bool
54
     */
55
    protected $supportsStreaming;
56
57
    /**
58
     * InputMediaVideo constructor.
59
     *
60
     * @param string $media
61
     * @param null $caption
62
     * @param null $parseMode
63
     * @param null $width
64
     * @param null $height
65
     * @param 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 string
89
     */
90
    public function getWidth()
91
    {
92
        return $this->width;
93
    }
94
95
    /**
96
     * @param string $width
97
     */
98
    public function setWidth($width)
99
    {
100
        $this->width = $width;
101
    }
102
103
    /**
104
     * @return string
105
     */
106
    public function getHeight()
107
    {
108
        return $this->height;
109
    }
110
111
    /**
112
     * @param string $height
113
     */
114
    public function setHeight($height)
115
    {
116
        $this->height = $height;
117
    }
118
119
    /**
120
     * @return string
121
     */
122
    public function getDuration()
123
    {
124
        return $this->duration;
125
    }
126
127
    /**
128
     * @param string $duration
129
     */
130
    public function setDuration($duration)
131
    {
132
        $this->duration = $duration;
133
    }
134
135
    /**
136
     * @return bool
137
     */
138
    public function getSupportsStreaming()
139
    {
140
        return $this->supportsStreaming;
141
    }
142
143
    /**
144
     * @param bool $supportsStreaming
145
     */
146
    public function setSupportsStreaming($supportsStreaming)
147
    {
148
        $this->supportsStreaming = $supportsStreaming;
149
    }
150
}
151