InlineQueryResultDocument::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
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 Longman\TelegramBot\Entities\InlineQuery;
13
14
use Longman\TelegramBot\Entities\InlineKeyboard;
15
use Longman\TelegramBot\Entities\InputMessageContent\InputMessageContent;
16
17
/**
18
 * Class InlineQueryResultDocument
19
 *
20
 * @link https://core.telegram.org/bots/api#inlinequeryresultdocument
21
 *
22
 * <code>
23
 * $data = [
24
 *   'id'                    => '',
25
 *   'title'                 => '',
26
 *   'caption'               => '',
27
 *   'document_url'          => '',
28
 *   'mime_type'             => '',
29
 *   'description'           => '',
30
 *   'reply_markup'          => <InlineKeyboard>,
31
 *   'input_message_content' => <InputMessageContent>,
32
 *   'thumb_url'             => '',
33
 *   'thumb_width'           => 30,
34
 *   'thumb_height'          => 30,
35
 * ];
36
 * </code>
37
 *
38
 * @method string               getType()                Type of the result, must be document
39
 * @method string               getId()                  Unique identifier for this result, 1-64 bytes
40
 * @method string               getTitle()               Title for the result
41
 * @method string               getCaption()             Optional. Caption of the document to be sent, 0-200 characters
42
 * @method string               getParseMode()           Optional. Mode for parsing entities in the document caption
43
 * @method MessageEntity[]      getCaptionEntities()     Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
44
 * @method string               getDocumentUrl()         A valid URL for the file
45
 * @method string               getMimeType()            Mime type of the content of the file, either “application/pdf” or “application/zip”
46
 * @method string               getDescription()         Optional. Short description of the result
47
 * @method InlineKeyboard       getReplyMarkup()         Optional. Inline keyboard attached to the message
48
 * @method InputMessageContent  getInputMessageContent() Optional. Content of the message to be sent instead of the file
49
 * @method string               getThumbUrl()            Optional. URL of the thumbnail (jpeg only) for the file
50
 * @method int                  getThumbWidth()          Optional. Thumbnail width
51
 * @method int                  getThumbHeight()         Optional. Thumbnail height
52
 *
53
 * @method $this setId(string $id)                                                  Unique identifier for this result, 1-64 bytes
54
 * @method $this setTitle(string $title)                                            Title for the result
55
 * @method $this setCaption(string $caption)                                        Optional. Caption of the document to be sent, 0-200 characters
56
 * @method $this setParseMode(string $parse_mode)                                   Optional. Mode for parsing entities in the document caption
57
 * @method $this setCaptionEntities(array $caption_entities)                        Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
58
 * @method $this setDocumentUrl(string $document_url)                               A valid URL for the file
59
 * @method $this setMimeType(string $mime_type)                                     Mime type of the content of the file, either “application/pdf” or “application/zip”
60
 * @method $this setDescription(string $description)                                Optional. Short description of the result
61
 * @method $this setReplyMarkup(InlineKeyboard $reply_markup)                       Optional. Inline keyboard attached to the message
62
 * @method $this setInputMessageContent(InputMessageContent $input_message_content) Optional. Content of the message to be sent instead of the file
63
 * @method $this setThumbUrl(string $thumb_url)                                     Optional. URL of the thumbnail (jpeg only) for the file
64
 * @method $this setThumbWidth(int $thumb_width)                                    Optional. Thumbnail width
65
 * @method $this setThumbHeight(int $thumb_height)                                  Optional. Thumbnail height
66
 */
67
class InlineQueryResultDocument extends InlineEntity implements InlineQueryResult
68
{
69
    /**
70
     * InlineQueryResultDocument constructor
71
     *
72
     * @param array $data
73
     */
74
    public function __construct(array $data = [])
75
    {
76
        $data['type'] = 'document';
77
        parent::__construct($data);
78
    }
79
}
80