Animation   A
last analyzed

Complexity

Total Complexity 18

Size/Duplication

Total Lines 209
Duplicated Lines 0 %

Importance

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

18 Methods

Rating   Name   Duplication   Size   Complexity  
A getFileId() 0 3 1
A getFileUniqueId() 0 3 1
A setThumb() 0 3 1
A setFileUniqueId() 0 3 1
A setFileSize() 0 3 1
A setWidth() 0 3 1
A setHeight() 0 3 1
A getFileName() 0 3 1
A setFileName() 0 3 1
A getMimeType() 0 3 1
A getFileSize() 0 3 1
A setDuration() 0 3 1
A getDuration() 0 3 1
A getHeight() 0 3 1
A setFileId() 0 3 1
A setMimeType() 0 3 1
A getThumb() 0 3 1
A getWidth() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Zanzara\Telegram\Type\File;
6
7
/**
8
 * This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
9
 *
10
 * More on https://core.telegram.org/bots/api#animation
11
 */
12
class Animation
13
{
14
15
    /**
16
     * Identifier for this file, which can be used to download or reuse the file
17
     *
18
     * @var string
19
     */
20
    private $file_id;
21
22
    /**
23
     * Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to
24
     * download or reuse the file.
25
     *
26
     * @var string
27
     */
28
    private $file_unique_id;
29
30
    /**
31
     * Video width as defined by sender
32
     *
33
     * @var int
34
     */
35
    private $width;
36
37
    /**
38
     * Video height as defined by sender
39
     *
40
     * @var int
41
     */
42
    private $height;
43
44
    /**
45
     * Duration of the video in seconds as defined by sender
46
     *
47
     * @var int
48
     */
49
    private $duration;
50
51
    /**
52
     * Optional. Animation thumbnail as defined by sender
53
     *
54
     * @var PhotoSize|null
55
     */
56
    private $thumb;
57
58
    /**
59
     * Optional. Original animation filename as defined by sender
60
     *
61
     * @var string|null
62
     */
63
    private $file_name;
64
65
    /**
66
     * Optional. MIME type of the file as defined by sender
67
     *
68
     * @var string|null
69
     */
70
    private $mime_type;
71
72
    /**
73
     * Optional. File size
74
     *
75
     * @var int|null
76
     */
77
    private $file_size;
78
79
    /**
80
     * @return string
81
     */
82
    public function getFileId(): string
83
    {
84
        return $this->file_id;
85
    }
86
87
    /**
88
     * @param string $file_id
89
     */
90
    public function setFileId(string $file_id): void
91
    {
92
        $this->file_id = $file_id;
93
    }
94
95
    /**
96
     * @return string
97
     */
98
    public function getFileUniqueId(): string
99
    {
100
        return $this->file_unique_id;
101
    }
102
103
    /**
104
     * @param string $file_unique_id
105
     */
106
    public function setFileUniqueId(string $file_unique_id): void
107
    {
108
        $this->file_unique_id = $file_unique_id;
109
    }
110
111
    /**
112
     * @return int
113
     */
114
    public function getWidth(): int
115
    {
116
        return $this->width;
117
    }
118
119
    /**
120
     * @param int $width
121
     */
122
    public function setWidth(int $width): void
123
    {
124
        $this->width = $width;
125
    }
126
127
    /**
128
     * @return int
129
     */
130
    public function getHeight(): int
131
    {
132
        return $this->height;
133
    }
134
135
    /**
136
     * @param int $height
137
     */
138
    public function setHeight(int $height): void
139
    {
140
        $this->height = $height;
141
    }
142
143
    /**
144
     * @return int
145
     */
146
    public function getDuration(): int
147
    {
148
        return $this->duration;
149
    }
150
151
    /**
152
     * @param int $duration
153
     */
154
    public function setDuration(int $duration): void
155
    {
156
        $this->duration = $duration;
157
    }
158
159
    /**
160
     * @return PhotoSize|null
161
     */
162
    public function getThumb(): ?PhotoSize
163
    {
164
        return $this->thumb;
165
    }
166
167
    /**
168
     * @param PhotoSize|null $thumb
169
     */
170
    public function setThumb(?PhotoSize $thumb): void
171
    {
172
        $this->thumb = $thumb;
173
    }
174
175
    /**
176
     * @return string|null
177
     */
178
    public function getFileName(): ?string
179
    {
180
        return $this->file_name;
181
    }
182
183
    /**
184
     * @param string|null $file_name
185
     */
186
    public function setFileName(?string $file_name): void
187
    {
188
        $this->file_name = $file_name;
189
    }
190
191
    /**
192
     * @return string|null
193
     */
194
    public function getMimeType(): ?string
195
    {
196
        return $this->mime_type;
197
    }
198
199
    /**
200
     * @param string|null $mime_type
201
     */
202
    public function setMimeType(?string $mime_type): void
203
    {
204
        $this->mime_type = $mime_type;
205
    }
206
207
    /**
208
     * @return int|null
209
     */
210
    public function getFileSize(): ?int
211
    {
212
        return $this->file_size;
213
    }
214
215
    /**
216
     * @param int|null $file_size
217
     */
218
    public function setFileSize(?int $file_size): void
219
    {
220
        $this->file_size = $file_size;
221
    }
222
223
}