Passed
Pull Request — master (#408)
by Alexander
01:43
created

Article::setThumbHeight()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace TelegramBot\Api\Types\Inline\QueryResult;
4
5
use TelegramBot\Api\Types\Inline\InlineKeyboardMarkup;
6
use TelegramBot\Api\Types\Inline\InputMessageContent;
7
8
/**
9
 * Class InlineQueryResultArticle
10
 * Represents a link to an article or web page.
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