Passed
Pull Request — develop (#1077)
by Marco
02:09
created

InlineQueryResultAudio   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
eloc 3
dl 0
loc 11
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of the TelegramBot package.
5
 *
6
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace PhpTelegramBot\Core\Entities\InlineQuery;
13
14
use PhpTelegramBot\Core\Entities\InlineKeyboard;
15
use PhpTelegramBot\Core\Entities\InputMessageContent\InputMessageContent;
16
17
/**
18
 * Class InlineQueryResultAudio
19
 *
20
 * @link https://core.telegram.org/bots/api#inlinequeryresultaudio
21
 *
22
 * <code>
23
 * $data = [
24
 *   'id'                    => '',
25
 *   'audio_url'             => '',
26
 *   'title'                 => '',
27
 *   'caption'               => '',
28
 *   'performer'             => '',
29
 *   'audio_duration'        => 123,
30
 *   'reply_markup'          => <InlineKeyboard>,
31
 *   'input_message_content' => <InputMessageContent>,
32
 * ];
33
 * </code>
34
 *
35
 * @method string               getType()                Type of the result, must be audio
36
 * @method string               getId()                  Unique identifier for this result, 1-64 bytes
37
 * @method string               getAudioUrl()            A valid URL for the audio file
38
 * @method string               getTitle()               Title
39
 * @method string               getCaption()             Optional. Caption, 0-200 characters
40
 * @method string               getPerformer()           Optional. Performer
41
 * @method int                  getAudioDuration()       Optional. Audio duration in seconds
42
 * @method InlineKeyboard       getReplyMarkup()         Optional. Inline keyboard attached to the message
43
 * @method InputMessageContent  getInputMessageContent() Optional. Content of the message to be sent instead of the audio
44
 *
45
 * @method $this setId(string $id)                                                  Unique identifier for this result, 1-64 bytes
46
 * @method $this setAudioUrl(string $audio_url)                                     A valid URL for the audio file
47
 * @method $this setTitle(string $title)                                            Title
48
 * @method $this setCaption(string $caption)                                        Optional. Caption, 0-200 characters
49
 * @method $this setPerformer(string $performer)                                    Optional. Performer
50
 * @method $this setAudioDuration(int $audio_duration)                              Optional. Audio duration in seconds
51
 * @method $this setReplyMarkup(InlineKeyboard $reply_markup)                       Optional. Inline keyboard attached to the message
52
 * @method $this setInputMessageContent(InputMessageContent $input_message_content) Optional. Content of the message to be sent instead of the audio
53
 */
54
class InlineQueryResultAudio extends InlineEntity implements InlineQueryResult
55
{
56
    /**
57
     * InlineQueryResultAudio constructor
58
     *
59
     * @param array $data
60
     */
61
    public function __construct(array $data = [])
62
    {
63
        $data['type'] = 'audio';
64
        parent::__construct($data);
65
    }
66
}
67