Code Duplication    Length = 182-204 lines in 3 locations

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

@@ 14-217 (lines=204) @@
11
 *
12
 * @package TelegramBot\Api\Types\Inline
13
 */
14
class Article extends AbstractInlineQueryResult
15
{
16
    /**
17
     * {@inheritdoc}
18
     *
19
     * @var array
20
     */
21
    static protected $requiredParams = ['type', 'id', 'title', 'input_message_content'];
22
23
    /**
24
     * {@inheritdoc}
25
     *
26
     * @var array
27
     */
28
    static protected $map = [
29
        'type' => true,
30
        'id' => true,
31
        'title' => true,
32
        'input_message_content' => InputMessageContent::class,
33
        'reply_markup' => InlineKeyboardMarkup::class,
34
        'url' => true,
35
        'hide_url' => true,
36
        'description' => true,
37
        'thumb_url' => true,
38
        'thumb_width' => true,
39
        'thumb_height' => true,
40
    ];
41
42
    /**
43
     * {@inheritdoc}
44
     *
45
     * @var string
46
     */
47
    protected $type = 'article';
48
49
    /**
50
     * Optional. URL of the result
51
     *
52
     * @var string
53
     */
54
    protected $url;
55
56
    /**
57
     * Optional. Pass True, if you don't want the URL to be shown in the message
58
     *
59
     * @var bool
60
     */
61
    protected $hideUrl;
62
63
    /**
64
     * Optional. Short description of the result
65
     *
66
     * @var string
67
     */
68
    protected $description;
69
70
    /**
71
     * Optional. Url of the thumbnail for the result
72
     *
73
     * @var string
74
     */
75
    protected $thumbUrl;
76
77
    /**
78
     * Optional. Thumbnail width
79
     *
80
     * @var int
81
     */
82
    protected $thumbWidth;
83
84
    /**
85
     * Optional. Thumbnail height
86
     *
87
     * @var int
88
     */
89
    protected $thumbHeight;
90
91
    /**
92
     * InlineQueryResultArticle constructor.
93
     *
94
     * @param string $id
95
     * @param string $title
96
     * @param string|null $description
97
     * @param string|null $thumbUrl
98
     * @param int|null $thumbWidth
99
     * @param int|null $thumbHeight
100
     * @param InputMessageContent $inputMessageContent
101
     * @param InlineKeyboardMarkup|null $inlineKeyboardMarkup
102
     */
103
    public function __construct(
104
        $id,
105
        $title,
106
        $description = null,
107
        $thumbUrl = null,
108
        $thumbWidth = null,
109
        $thumbHeight = null,
110
        $inputMessageContent = null,
111
        $inlineKeyboardMarkup = null
112
    ) {
113
        parent::__construct($id, $title, $inputMessageContent, $inlineKeyboardMarkup);
114
115
        $this->description = $description;
116
        $this->thumbUrl = $thumbUrl;
117
        $this->thumbWidth = $thumbWidth;
118
        $this->thumbHeight = $thumbHeight;
119
    }
120
121
122
    /**
123
     * @return string
124
     */
125
    public function getUrl()
126
    {
127
        return $this->url;
128
    }
129
130
    /**
131
     * @param string $url
132
     */
133
    public function setUrl($url)
134
    {
135
        $this->url = $url;
136
    }
137
138
    /**
139
     * @return boolean
140
     */
141
    public function isHideUrl()
142
    {
143
        return $this->hideUrl;
144
    }
145
146
    /**
147
     * @param boolean $hideUrl
148
     */
149
    public function setHideUrl($hideUrl)
150
    {
151
        $this->hideUrl = $hideUrl;
152
    }
153
154
    /**
155
     * @return string
156
     */
157
    public function getDescription()
158
    {
159
        return $this->description;
160
    }
161
162
    /**
163
     * @param string $description
164
     */
165
    public function setDescription($description)
166
    {
167
        $this->description = $description;
168
    }
169
170
    /**
171
     * @return string
172
     */
173
    public function getThumbUrl()
174
    {
175
        return $this->thumbUrl;
176
    }
177
178
    /**
179
     * @param string $thumbUrl
180
     */
181
    public function setThumbUrl($thumbUrl)
182
    {
183
        $this->thumbUrl = $thumbUrl;
184
    }
185
186
    /**
187
     * @return int
188
     */
189
    public function getThumbWidth()
190
    {
191
        return $this->thumbWidth;
192
    }
193
194
    /**
195
     * @param int $thumbWidth
196
     */
197
    public function setThumbWidth($thumbWidth)
198
    {
199
        $this->thumbWidth = $thumbWidth;
200
    }
201
202
    /**
203
     * @return int
204
     */
205
    public function getThumbHeight()
206
    {
207
        return $this->thumbHeight;
208
    }
209
210
    /**
211
     * @param int $thumbHeight
212
     */
213
    public function setThumbHeight($thumbHeight)
214
    {
215
        $this->thumbHeight = $thumbHeight;
216
    }
217
}
218

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

@@ 16-198 (lines=183) @@
13
 *
14
 * @package TelegramBot\Api\Types\Inline
15
 */
16
class Mpeg4Gif extends AbstractInlineQueryResult
17
{
18
    /**
19
     * {@inheritdoc}
20
     *
21
     * @var array
22
     */
23
    static protected $requiredParams = ['type', 'id', 'mpeg4_url', 'thumb_url'];
24
25
    /**
26
     * {@inheritdoc}
27
     *
28
     * @var array
29
     */
30
    static protected $map = [
31
        'type' => true,
32
        'id' => true,
33
        'mpeg4_url' => true,
34
        'mpeg4_width' => true,
35
        'mpeg4_height' => true,
36
        'thumb_url' => true,
37
        'title' => true,
38
        'caption' => true,
39
        'reply_markup' => InlineKeyboardMarkup::class,
40
        'input_message_content' => InputMessageContent::class,
41
    ];
42
43
    /**
44
     * {@inheritdoc}
45
     *
46
     * @var string
47
     */
48
    protected $type = 'mpeg4_gif';
49
50
    /**
51
     * A valid URL for the MP4 file. File size must not exceed 1MB
52
     *
53
     * @var string
54
     */
55
    protected $mpeg4Url;
56
57
    /**
58
     * Optional. Video width
59
     *
60
     * @var int
61
     */
62
    protected $mpeg4Width;
63
64
    /**
65
     * Optional. Video height
66
     *
67
     * @var int
68
     */
69
    protected $mpeg4Height;
70
71
    /**
72
     * URL of the static thumbnail (jpeg or gif) for the result
73
     *
74
     * @var string
75
     */
76
    protected $thumbUrl;
77
78
    /**
79
     * Optional. Caption of the MPEG-4 file to be sent, 0-200 characters
80
     *
81
     * @var string
82
     */
83
    protected $caption;
84
85
    /**
86
     * InlineQueryResultMpeg4Gif constructor.
87
     *
88
     * @param string $id
89
     * @param string $mpeg4Url
90
     * @param string $thumbUrl
91
     * @param int|null $mpeg4Width
92
     * @param int|null $mpeg4Height
93
     * @param string|null $caption
94
     * @param string|null $title
95
     * @param InputMessageContent $inputMessageContent
96
     * @param InlineKeyboardMarkup|null $inlineKeyboardMarkup
97
     */
98
    public function __construct(
99
        $id,
100
        $mpeg4Url,
101
        $thumbUrl,
102
        $title = null,
103
        $caption = null,
104
        $mpeg4Width = null,
105
        $mpeg4Height = null,
106
        $inputMessageContent = null,
107
        $inlineKeyboardMarkup = null
108
    ) {
109
        parent::__construct($id, $title, $inputMessageContent, $inlineKeyboardMarkup);
110
111
        $this->mpeg4Url = $mpeg4Url;
112
        $this->thumbUrl = $thumbUrl;
113
        $this->mpeg4Width = $mpeg4Width;
114
        $this->mpeg4Height = $mpeg4Height;
115
        $this->caption = $caption;
116
    }
117
118
119
    /**
120
     * @return string
121
     */
122
    public function getMpeg4Url()
123
    {
124
        return $this->mpeg4Url;
125
    }
126
127
    /**
128
     * @param string $mpeg4Url
129
     */
130
    public function setMpeg4Url($mpeg4Url)
131
    {
132
        $this->mpeg4Url = $mpeg4Url;
133
    }
134
135
    /**
136
     * @return int
137
     */
138
    public function getMpeg4Width()
139
    {
140
        return $this->mpeg4Width;
141
    }
142
143
    /**
144
     * @param int $mpeg4Width
145
     */
146
    public function setMpeg4Width($mpeg4Width)
147
    {
148
        $this->mpeg4Width = $mpeg4Width;
149
    }
150
151
    /**
152
     * @return int
153
     */
154
    public function getMpeg4Height()
155
    {
156
        return $this->mpeg4Height;
157
    }
158
159
    /**
160
     * @param int $mpeg4Height
161
     */
162
    public function setMpeg4Height($mpeg4Height)
163
    {
164
        $this->mpeg4Height = $mpeg4Height;
165
    }
166
167
    /**
168
     * @return string
169
     */
170
    public function getThumbUrl()
171
    {
172
        return $this->thumbUrl;
173
    }
174
175
    /**
176
     * @param string $thumbUrl
177
     */
178
    public function setThumbUrl($thumbUrl)
179
    {
180
        $this->thumbUrl = $thumbUrl;
181
    }
182
183
    /**
184
     * @return string
185
     */
186
    public function getCaption()
187
    {
188
        return $this->caption;
189
    }
190
191
    /**
192
     * @param string $caption
193
     */
194
    public function setCaption($caption)
195
    {
196
        $this->caption = $caption;
197
    }
198
}
199

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

@@ 25-206 (lines=182) @@
22
 *
23
 * @package TelegramBot\Api\Types\Inline\QueryResult
24
 */
25
class Location extends AbstractInlineQueryResult
26
{
27
    /**
28
     * {@inheritdoc}
29
     *
30
     * @var array
31
     */
32
    static protected $requiredParams = ['type', 'id', 'latitude', 'longitude', 'title'];
33
34
    /**
35
     * {@inheritdoc}
36
     *
37
     * @var array
38
     */
39
    static protected $map = [
40
        'type' => true,
41
        'id' => true,
42
        'latitude' => true,
43
        'longitude' => true,
44
        'title' => true,
45
        'thumb_url' => true,
46
        'thumb_width' => true,
47
        'thumb_height' => true,
48
        'reply_markup' => InlineKeyboardMarkup::class,
49
        'input_message_content' => InputMessageContent::class,
50
    ];
51
52
    /**
53
     * {@inheritdoc}
54
     *
55
     * @var string
56
     */
57
    protected $type = 'location';
58
59
    /**
60
     * Location latitude in degrees
61
     *
62
     * @var float
63
     */
64
    protected $latitude;
65
66
    /**
67
     * Location longitude in degrees
68
     *
69
     * @var float
70
     */
71
    protected $longitude;
72
73
    /**
74
     * Optional. Url of the thumbnail for the result
75
     *
76
     * @var string
77
     */
78
    protected $thumbUrl;
79
80
    /**
81
     * Optional. Thumbnail width
82
     *
83
     * @var int
84
     */
85
    protected $thumbWidth;
86
87
    /**
88
     * Optional. Thumbnail height
89
     *
90
     * @var int
91
     */
92
    protected $thumbHeight;
93
94
    /**
95
     * Voice constructor
96
     *
97
     * @param string $id
98
     * @param float $latitude
99
     * @param float $longitude
100
     * @param string $title
101
     * @param string $thumbUrl
102
     * @param int $thumbWidth
103
     * @param int $thumbHeight
104
     * @param InlineKeyboardMarkup|null $inlineKeyboardMarkup
105
     * @param InputMessageContent|null $inputMessageContent
106
     */
107
    public function __construct(
108
        $id,
109
        $latitude,
110
        $longitude,
111
        $title,
112
        $thumbUrl = null,
113
        $thumbWidth = null,
114
        $thumbHeight = null,
115
        $inlineKeyboardMarkup = null,
116
        $inputMessageContent = null
117
    ) {
118
        parent::__construct($id, $title, $inputMessageContent, $inlineKeyboardMarkup);
119
120
        $this->latitude = $latitude;
121
        $this->longitude = $longitude;
122
        $this->thumbUrl = $thumbUrl;
123
        $this->thumbWidth = $thumbWidth;
124
        $this->thumbHeight = $thumbHeight;
125
    }
126
127
    /**
128
     * @return float
129
     */
130
    public function getLatitude()
131
    {
132
        return $this->latitude;
133
    }
134
135
    /**
136
     * @param float $latitude
137
     */
138
    public function setLatitude($latitude)
139
    {
140
        $this->latitude = $latitude;
141
    }
142
143
    /**
144
     * @return float
145
     */
146
    public function getLongitude()
147
    {
148
        return $this->longitude;
149
    }
150
151
    /**
152
     * @param float $longitude
153
     */
154
    public function setLongitude($longitude)
155
    {
156
        $this->longitude = $longitude;
157
    }
158
159
    /**
160
     * @return string
161
     */
162
    public function getThumbUrl()
163
    {
164
        return $this->thumbUrl;
165
    }
166
167
    /**
168
     * @param string $thumbUrl
169
     */
170
    public function setThumbUrl($thumbUrl)
171
    {
172
        $this->thumbUrl = $thumbUrl;
173
    }
174
175
    /**
176
     * @return int
177
     */
178
    public function getThumbWidth()
179
    {
180
        return $this->thumbWidth;
181
    }
182
183
    /**
184
     * @param int $thumbWidth
185
     */
186
    public function setThumbWidth($thumbWidth)
187
    {
188
        $this->thumbWidth = $thumbWidth;
189
    }
190
191
    /**
192
     * @return int
193
     */
194
    public function getThumbHeight()
195
    {
196
        return $this->thumbHeight;
197
    }
198
199
    /**
200
     * @param int $thumbHeight
201
     */
202
    public function setThumbHeight($thumbHeight)
203
    {
204
        $this->thumbHeight = $thumbHeight;
205
    }
206
}
207