InlineQueryResultVoice   A
last analyzed

Complexity

Total Complexity 16

Size/Duplication

Total Lines 188
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 25
dl 0
loc 188
rs 10
c 1
b 0
f 0
wmc 16

16 Methods

Rating   Name   Duplication   Size   Complexity  
A getCaptionEntities() 0 3 1
A getParseMode() 0 3 1
A setVoiceUrl() 0 3 1
A getCaption() 0 3 1
A setCaption() 0 3 1
A getReplyMarkup() 0 3 1
A setVoiceDuration() 0 3 1
A getInputMessageContent() 0 3 1
A setInputMessageContent() 0 3 1
A getTitle() 0 3 1
A setTitle() 0 3 1
A getVoiceDuration() 0 3 1
A setCaptionEntities() 0 3 1
A getVoiceUrl() 0 3 1
A setParseMode() 0 3 1
A setReplyMarkup() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Zanzara\Telegram\Type\InlineQueryResult;
6
7
use Zanzara\Telegram\Type\Input\InputMessageContent;
8
use Zanzara\Telegram\Type\Keyboard\InlineKeyboardMarkup;
9
10
/**
11
 * Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will
12
 * be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content
13
 * instead of the the voice message.
14
 *
15
 * More on https://core.telegram.org/bots/api#inlinequeryresultvoice
16
 */
17
class InlineQueryResultVoice extends InlineQueryResult
18
{
19
20
    /**
21
     * A valid URL for the voice recording
22
     *
23
     * @var string
24
     */
25
    private $voice_url;
26
27
    /**
28
     * Recording title
29
     *
30
     * @var string
31
     */
32
    private $title;
33
34
    /**
35
     * Optional. Caption, 0-1024 characters after entities parsing
36
     *
37
     * @var string|null
38
     */
39
    private $caption;
40
41
    /**
42
     * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in
43
     * the media caption.
44
     *
45
     * @var string|null
46
     */
47
    private $parse_mode;
48
49
    /**
50
     * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
51
     *
52
     * @since zanzara 0.5.0, Telegram Bot Api 5.0
53
     *
54
     * @var \Zanzara\Telegram\Type\MessageEntity[]|null
55
     */
56
    private $caption_entities;
57
58
    /**
59
     * Optional. Recording duration in seconds
60
     *
61
     * @var int|null
62
     */
63
    private $voice_duration;
64
65
    /**
66
     * Optional. Inline keyboard attached to the message
67
     *
68
     * @var InlineKeyboardMarkup|null
69
     */
70
    private $reply_markup;
71
72
    /**
73
     * Optional. Content of the message to be sent instead of the voice recording
74
     *
75
     * @var InputMessageContent|null
76
     */
77
    private $input_message_content;
78
79
    /**
80
     * @return string
81
     */
82
    public function getVoiceUrl(): string
83
    {
84
        return $this->voice_url;
85
    }
86
87
    /**
88
     * @param string $voice_url
89
     */
90
    public function setVoiceUrl(string $voice_url): void
91
    {
92
        $this->voice_url = $voice_url;
93
    }
94
95
    /**
96
     * @return string
97
     */
98
    public function getTitle(): string
99
    {
100
        return $this->title;
101
    }
102
103
    /**
104
     * @param string $title
105
     */
106
    public function setTitle(string $title): void
107
    {
108
        $this->title = $title;
109
    }
110
111
    /**
112
     * @return string|null
113
     */
114
    public function getCaption(): ?string
115
    {
116
        return $this->caption;
117
    }
118
119
    /**
120
     * @param string|null $caption
121
     */
122
    public function setCaption(?string $caption): void
123
    {
124
        $this->caption = $caption;
125
    }
126
127
    /**
128
     * @return string|null
129
     */
130
    public function getParseMode(): ?string
131
    {
132
        return $this->parse_mode;
133
    }
134
135
    /**
136
     * @param string|null $parse_mode
137
     */
138
    public function setParseMode(?string $parse_mode): void
139
    {
140
        $this->parse_mode = $parse_mode;
141
    }
142
143
    /**
144
     * @return int|null
145
     */
146
    public function getVoiceDuration(): ?int
147
    {
148
        return $this->voice_duration;
149
    }
150
151
    /**
152
     * @param int|null $voice_duration
153
     */
154
    public function setVoiceDuration(?int $voice_duration): void
155
    {
156
        $this->voice_duration = $voice_duration;
157
    }
158
159
    /**
160
     * @return InlineKeyboardMarkup|null
161
     */
162
    public function getReplyMarkup(): ?InlineKeyboardMarkup
163
    {
164
        return $this->reply_markup;
165
    }
166
167
    /**
168
     * @param InlineKeyboardMarkup|null $reply_markup
169
     */
170
    public function setReplyMarkup(?InlineKeyboardMarkup $reply_markup): void
171
    {
172
        $this->reply_markup = $reply_markup;
173
    }
174
175
    /**
176
     * @return InputMessageContent|null
177
     */
178
    public function getInputMessageContent(): ?InputMessageContent
179
    {
180
        return $this->input_message_content;
181
    }
182
183
    /**
184
     * @param InputMessageContent|null $input_message_content
185
     */
186
    public function setInputMessageContent(?InputMessageContent $input_message_content): void
187
    {
188
        $this->input_message_content = $input_message_content;
189
    }
190
191
    /**
192
     * @return \Zanzara\Telegram\Type\MessageEntity[]|null
193
     */
194
    public function getCaptionEntities(): ?array
195
    {
196
        return $this->caption_entities;
197
    }
198
199
    /**
200
     * @param \Zanzara\Telegram\Type\MessageEntity[]|null $caption_entities
201
     */
202
    public function setCaptionEntities(?array $caption_entities): void
203
    {
204
        $this->caption_entities = $caption_entities;
205
    }
206
207
}