Code Duplication    Length = 240-240 lines in 2 locations

src/Types/Inline/QueryResult/Photo.php 1 location

@@ 12-251 (lines=240) @@
9
 *
10
 * @package TelegramBot\Api\Types\Inline
11
 */
12
class Photo extends AbstractInlineQueryResult
13
{
14
    /**
15
     * {@inheritdoc}
16
     *
17
     * @var array
18
     */
19
    static protected $requiredParams = ['type', 'id', 'photo_url', 'thumb_url'];
20
21
    /**
22
     * {@inheritdoc}
23
     *
24
     * @var array
25
     */
26
    static protected $map = [
27
        'type' => true,
28
        'id' => true,
29
        'photo_url' => true,
30
        'mime_type' => true,
31
        'photo_width' => true,
32
        'photo_height' => true,
33
        'thumb_url' => true,
34
        'title' => true,
35
        'description' => true,
36
        'caption' => true,
37
        'message_text' => true,
38
        'parse_mode' => true,
39
        'disable_web_page_preview' => true,
40
    ];
41
42
    /**
43
     * {@inheritdoc}
44
     *
45
     * @var string
46
     */
47
    protected $type = 'photo';
48
49
    /**
50
     * A valid URL of the photo. Photo size must not exceed 5MB
51
     *
52
     * @var string
53
     */
54
    protected $photoUrl;
55
56
    /**
57
     * Optional. MIME type of the photo, defaults to image/jpeg
58
     *
59
     * @var string
60
     */
61
    protected $mimeType;
62
63
    /**
64
     * Optional. Width of the photo
65
     *
66
     * @var int
67
     */
68
    protected $photoWidth;
69
70
    /**
71
     * Optional. Height of the photo
72
     *
73
     * @var int
74
     */
75
    protected $photoHeight;
76
77
    /**
78
     * URL of the thumbnail for the photo
79
     *
80
     * @var
81
     */
82
    protected $thumbUrl;
83
84
    /**
85
     * Optional. Short description of the result
86
     *
87
     * @var string
88
     */
89
    protected $description;
90
91
    /**
92
     * Optional. Caption of the photo to be sent, 0-200 characters
93
     *
94
     * @var string
95
     */
96
    protected $caption;
97
98
    /**
99
     * InlineQueryResultPhoto constructor.
100
     *
101
     * @param string $id
102
     * @param string $photoUrl
103
     * @param string $thumbUrl
104
     * @param string|null $mimeType
105
     * @param int|null $photoWidth
106
     * @param int|null $photoHeight
107
     * @param string|null $title
108
     * @param string|null $description
109
     * @param string|null $caption
110
     * @param string|null $messageText
111
     * @param string|null $parseMode
112
     * @param bool|null $disableWebPagePreview
113
     */
114
    public function __construct(
115
        $id,
116
        $photoUrl,
117
        $thumbUrl,
118
        $mimeType = null,
119
        $photoWidth = null,
120
        $photoHeight = null,
121
        $title = null,
122
        $description = null,
123
        $caption = null,
124
        $messageText = null,
125
        $parseMode = null,
126
        $disableWebPagePreview = null
127
    ) {
128
        parent::__construct($id, $title, $messageText, $parseMode, $disableWebPagePreview);
129
130
        $this->photoUrl = $photoUrl;
131
        $this->thumbUrl = $thumbUrl;
132
        $this->mimeType = $mimeType;
133
        $this->photoWidth = $photoWidth;
134
        $this->photoHeight = $photoHeight;
135
        $this->description = $description;
136
        $this->caption = $caption;
137
    }
138
139
140
    /**
141
     * @return string
142
     */
143
    public function getPhotoUrl()
144
    {
145
        return $this->photoUrl;
146
    }
147
148
    /**
149
     * @param string $photoUrl
150
     */
151
    public function setPhotoUrl($photoUrl)
152
    {
153
        $this->photoUrl = $photoUrl;
154
    }
155
156
    /**
157
     * @return string
158
     */
159
    public function getMimeType()
160
    {
161
        return $this->mimeType;
162
    }
163
164
    /**
165
     * @param string $mimeType
166
     */
167
    public function setMimeType($mimeType)
168
    {
169
        $this->mimeType = $mimeType;
170
    }
171
172
    /**
173
     * @return int
174
     */
175
    public function getPhotoWidth()
176
    {
177
        return $this->photoWidth;
178
    }
179
180
    /**
181
     * @param int $photoWidth
182
     */
183
    public function setPhotoWidth($photoWidth)
184
    {
185
        $this->photoWidth = $photoWidth;
186
    }
187
188
    /**
189
     * @return int
190
     */
191
    public function getPhotoHeight()
192
    {
193
        return $this->photoHeight;
194
    }
195
196
    /**
197
     * @param int $photoHeight
198
     */
199
    public function setPhotoHeight($photoHeight)
200
    {
201
        $this->photoHeight = $photoHeight;
202
    }
203
204
    /**
205
     * @return mixed
206
     */
207
    public function getThumbUrl()
208
    {
209
        return $this->thumbUrl;
210
    }
211
212
    /**
213
     * @param mixed $thumbUrl
214
     */
215
    public function setThumbUrl($thumbUrl)
216
    {
217
        $this->thumbUrl = $thumbUrl;
218
    }
219
220
    /**
221
     * @return string
222
     */
223
    public function getDescription()
224
    {
225
        return $this->description;
226
    }
227
228
    /**
229
     * @param string $description
230
     */
231
    public function setDescription($description)
232
    {
233
        $this->description = $description;
234
    }
235
236
    /**
237
     * @return string
238
     */
239
    public function getCaption()
240
    {
241
        return $this->caption;
242
    }
243
244
    /**
245
     * @param string $caption
246
     */
247
    public function setCaption($caption)
248
    {
249
        $this->caption = $caption;
250
    }
251
}
252

src/Types/Inline/QueryResult/Video.php 1 location

@@ 11-250 (lines=240) @@
8
 *
9
 * @package TelegramBot\Api\Types\Inline
10
 */
11
class Video extends AbstractInlineQueryResult
12
{
13
    /**
14
     * {@inheritdoc}
15
     *
16
     * @var array
17
     */
18
    static protected $requiredParams = ['type', 'id', 'video_url', 'mime_type', 'thumb_url'];
19
20
    /**
21
     * {@inheritdoc}
22
     *
23
     * @var array
24
     */
25
    static protected $map = [
26
        'type' => true,
27
        'id' => true,
28
        'video_url' => true,
29
        'mime_type' => true,
30
        'message_text' => true,
31
        'parse_mode' => true,
32
        'disable_web_page_preview' => true,
33
        'video_width' => true,
34
        'video_height' => true,
35
        'video_duration' => true,
36
        'thumb_url' => true,
37
        'title' => true,
38
        'description' => true,
39
    ];
40
41
    /**
42
     * {@inheritdoc}
43
     *
44
     * @var string
45
     */
46
    protected $type = 'video';
47
48
    /**
49
     * A valid URL for the embedded video player or video file
50
     *
51
     * @var string
52
     */
53
    protected $videoUrl;
54
55
    /**
56
     * Mime type of the content of video url, “text/html” or “video/mp4”
57
     *
58
     * @var string
59
     */
60
    protected $mimeType;
61
62
    /**
63
     * Optional. Video width
64
     *
65
     * @var int
66
     */
67
    protected $videoWidth;
68
69
    /**
70
     * Optional. Video height
71
     *
72
     * @var int
73
     */
74
    protected $videoHeight;
75
76
    /**
77
     * Optional. Video duration in seconds
78
     *
79
     * @var int
80
     */
81
    protected $videoDuration;
82
83
    /**
84
     * URL of the thumbnail (jpeg only) for the video
85
     *
86
     * @var string
87
     */
88
    protected $thumbUrl;
89
90
    /**
91
     * Optional. Short description of the result
92
     *
93
     * @var string
94
     */
95
    protected $description;
96
97
    /**
98
     * InlineQueryResultVideo constructor.
99
     *
100
     * @param string $id
101
     * @param string $videoUrl
102
     * @param string $thumbUrl
103
     * @param string $mimeType
104
     * @param string|null $messageText
105
     * @param string|null $parseMode
106
     * @param bool|null $disableWebPagePreview
107
     * @param int|null $videoWidth
108
     * @param int|null $videoHeight
109
     * @param int|null $videoDuration
110
     * @param string|null $title
111
     * @param string|null $description
112
     */
113
    public function __construct(
114
        $id,
115
        $videoUrl,
116
        $thumbUrl,
117
        $mimeType,
118
        $messageText = null,
119
        $parseMode = null,
120
        $disableWebPagePreview = null,
121
        $videoWidth = null,
122
        $videoHeight = null,
123
        $videoDuration = null,
124
        $title = null,
125
        $description = null
126
    ) {
127
        parent::__construct($id, $title, $messageText, $parseMode, $disableWebPagePreview);
128
        
129
        $this->videoUrl = $videoUrl;
130
        $this->thumbUrl = $thumbUrl;
131
        $this->mimeType = $mimeType;
132
        $this->videoWidth = $videoWidth;
133
        $this->videoHeight = $videoHeight;
134
        $this->videoDuration = $videoDuration;
135
        $this->description = $description;
136
    }
137
138
139
    /**
140
     * @return string
141
     */
142
    public function getVideoUrl()
143
    {
144
        return $this->videoUrl;
145
    }
146
147
    /**
148
     * @param string $videoUrl
149
     */
150
    public function setVideoUrl($videoUrl)
151
    {
152
        $this->videoUrl = $videoUrl;
153
    }
154
155
    /**
156
     * @return string
157
     */
158
    public function getMimeType()
159
    {
160
        return $this->mimeType;
161
    }
162
163
    /**
164
     * @param string $mimeType
165
     */
166
    public function setMimeType($mimeType)
167
    {
168
        $this->mimeType = $mimeType;
169
    }
170
171
    /**
172
     * @return int
173
     */
174
    public function getVideoWidth()
175
    {
176
        return $this->videoWidth;
177
    }
178
179
    /**
180
     * @param int $videoWidth
181
     */
182
    public function setVideoWidth($videoWidth)
183
    {
184
        $this->videoWidth = $videoWidth;
185
    }
186
187
    /**
188
     * @return int
189
     */
190
    public function getVideoHeight()
191
    {
192
        return $this->videoHeight;
193
    }
194
195
    /**
196
     * @param int $videoHeight
197
     */
198
    public function setVideoHeight($videoHeight)
199
    {
200
        $this->videoHeight = $videoHeight;
201
    }
202
203
    /**
204
     * @return int
205
     */
206
    public function getVideoDuration()
207
    {
208
        return $this->videoDuration;
209
    }
210
211
    /**
212
     * @param int $videoDuration
213
     */
214
    public function setVideoDuration($videoDuration)
215
    {
216
        $this->videoDuration = $videoDuration;
217
    }
218
219
    /**
220
     * @return mixed
221
     */
222
    public function getThumbUrl()
223
    {
224
        return $this->thumbUrl;
225
    }
226
227
    /**
228
     * @param mixed $thumbUrl
229
     */
230
    public function setThumbUrl($thumbUrl)
231
    {
232
        $this->thumbUrl = $thumbUrl;
233
    }
234
235
    /**
236
     * @return string
237
     */
238
    public function getDescription()
239
    {
240
        return $this->description;
241
    }
242
243
    /**
244
     * @param string $description
245
     */
246
    public function setDescription($description)
247
    {
248
        $this->description = $description;
249
    }
250
}
251