InputMediaAnimation   A
last analyzed

Complexity

Total Complexity 18

Size/Duplication

Total Lines 217
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 28
dl 0
loc 217
rs 10
c 1
b 0
f 0
wmc 18

18 Methods

Rating   Name   Duplication   Size   Complexity  
A setMedia() 0 3 1
A setCaption() 0 3 1
A getDuration() 0 3 1
A setParseMode() 0 3 1
A setWidth() 0 3 1
A getParseMode() 0 3 1
A getCaption() 0 3 1
A getCaptionEntities() 0 3 1
A getType() 0 3 1
A getMedia() 0 3 1
A getWidth() 0 3 1
A setDuration() 0 3 1
A setCaptionEntities() 0 3 1
A setThumb() 0 3 1
A setHeight() 0 3 1
A setType() 0 3 1
A getThumb() 0 3 1
A getHeight() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Zanzara\Telegram\Type\Input;
6
/**
7
 * Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.
8
 *
9
 * More on https://core.telegram.org/bots/api#inputmediaanimation
10
 */
11
class InputMediaAnimation
12
{
13
14
    /**
15
     * Type of the result, must be animation
16
     *
17
     * @var string
18
     */
19
    private $type;
20
21
    /**
22
     * File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for
23
     * Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using
24
     * multipart/form-data under <file_attach_name> name. More info on Sending Files >>
25
     *
26
     * @var string
27
     */
28
    private $media;
29
30
    /**
31
     * Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side.
32
     * The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not
33
     * exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be
34
     * only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using
35
     * multipart/form-data under <file_attach_name>. More info on Sending Files >>
36
     *
37
     * @var InputFile or String|null
38
     */
39
    private $thumb;
40
41
    /**
42
     * Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing
43
     *
44
     * @var string|null
45
     */
46
    private $caption;
47
48
    /**
49
     * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in
50
     * the media caption.
51
     *
52
     * @var string|null
53
     */
54
    private $parse_mode;
55
56
    /**
57
     * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
58
     *
59
     * @since zanzara 0.5.0, Telegram Bot Api 5.0
60
     *
61
     * @var \Zanzara\Telegram\Type\MessageEntity[]|null
62
     */
63
    private $caption_entities;
64
65
    /**
66
     * Optional. Animation width
67
     *
68
     * @var int|null
69
     */
70
    private $width;
71
72
    /**
73
     * Optional. Animation height
74
     *
75
     * @var int|null
76
     */
77
    private $height;
78
79
    /**
80
     * Optional. Animation duration
81
     *
82
     * @var int|null
83
     */
84
    private $duration;
85
86
    /**
87
     * @return string
88
     */
89
    public function getType(): string
90
    {
91
        return $this->type;
92
    }
93
94
    /**
95
     * @param string $type
96
     */
97
    public function setType(string $type): void
98
    {
99
        $this->type = $type;
100
    }
101
102
    /**
103
     * @return string
104
     */
105
    public function getMedia(): string
106
    {
107
        return $this->media;
108
    }
109
110
    /**
111
     * @param string $media
112
     */
113
    public function setMedia(string $media): void
114
    {
115
        $this->media = $media;
116
    }
117
118
    /**
119
     * @return InputFile
120
     */
121
    public function getThumb(): InputFile
122
    {
123
        return $this->thumb;
124
    }
125
126
    /**
127
     * @param InputFile $thumb
128
     */
129
    public function setThumb(InputFile $thumb): void
130
    {
131
        $this->thumb = $thumb;
132
    }
133
134
    /**
135
     * @return string|null
136
     */
137
    public function getCaption(): ?string
138
    {
139
        return $this->caption;
140
    }
141
142
    /**
143
     * @param string|null $caption
144
     */
145
    public function setCaption(?string $caption): void
146
    {
147
        $this->caption = $caption;
148
    }
149
150
    /**
151
     * @return string|null
152
     */
153
    public function getParseMode(): ?string
154
    {
155
        return $this->parse_mode;
156
    }
157
158
    /**
159
     * @param string|null $parse_mode
160
     */
161
    public function setParseMode(?string $parse_mode): void
162
    {
163
        $this->parse_mode = $parse_mode;
164
    }
165
166
    /**
167
     * @return int|null
168
     */
169
    public function getWidth(): ?int
170
    {
171
        return $this->width;
172
    }
173
174
    /**
175
     * @param int|null $width
176
     */
177
    public function setWidth(?int $width): void
178
    {
179
        $this->width = $width;
180
    }
181
182
    /**
183
     * @return int|null
184
     */
185
    public function getHeight(): ?int
186
    {
187
        return $this->height;
188
    }
189
190
    /**
191
     * @param int|null $height
192
     */
193
    public function setHeight(?int $height): void
194
    {
195
        $this->height = $height;
196
    }
197
198
    /**
199
     * @return int|null
200
     */
201
    public function getDuration(): ?int
202
    {
203
        return $this->duration;
204
    }
205
206
    /**
207
     * @param int|null $duration
208
     */
209
    public function setDuration(?int $duration): void
210
    {
211
        $this->duration = $duration;
212
    }
213
214
    /**
215
     * @return \Zanzara\Telegram\Type\MessageEntity[]|null
216
     */
217
    public function getCaptionEntities(): ?array
218
    {
219
        return $this->caption_entities;
220
    }
221
222
    /**
223
     * @param \Zanzara\Telegram\Type\MessageEntity[]|null $caption_entities
224
     */
225
    public function setCaptionEntities(?array $caption_entities): void
226
    {
227
        $this->caption_entities = $caption_entities;
228
    }
229
230
}