Completed
Push — master ( 588078...30ae0c )
by Nikolay
04:51 queued 02:15
created

InlineQueryResultCachedDocumentType   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 14
dl 0
loc 64
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Greenplugin\TelegramBot\Type\InlineQueryResult;
6
7
use Greenplugin\TelegramBot\Method\Traits\FillFromArrayTrait;
8
use Greenplugin\TelegramBot\Type\InputMessageContent\InputMessageContentType;
9
10
/**
11
 * Class InlineQueryResultCachedDocumentType.
12
 *
13
 * @see https://core.telegram.org/bots/api#inlinequeryresultcacheddocument
14
 */
15
class InlineQueryResultCachedDocumentType extends InlineQueryResultType
16
{
17
    use FillFromArrayTrait;
18
    /**
19
     * Title for the result;.
20
     *
21
     * @var string
22
     */
23
    public $title;
24
25
    /**
26
     * A valid file identifier for the file.
27
     *
28
     * @var string
29
     */
30
    public $documentFileId;
31
32
    /**
33
     * Optional. Caption of the document to be sent, 0-1024 characters.
34
     *
35
     * @var string|null
36
     */
37
    public $caption;
38
39
    /**
40
     * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic,
41
     * fixed-width text or inline URLs in the media caption.
42
     *
43
     * @var string|null
44
     */
45
    public $parseMode;
46
47
    /**
48
     * Optional. Short description of the result.
49
     *
50
     * @var string|null
51
     */
52
    public $description;
53
54
    /**
55
     * Optional. Content of the message to be sent instead of the file.
56
     *
57
     * @var InputMessageContentType|null
58
     */
59
    public $inputMessageContent;
60
61
    /**
62
     * InlineQueryResultCachedDocumentType constructor.
63
     *
64
     * @param string     $id
65
     * @param string     $title
66
     * @param string     $documentFileId
67
     * @param array|null $data
68
     *
69
     * @throws \Greenplugin\TelegramBot\Exception\BadArgumentException
70
     */
71
    public function __construct(string $id, string $title, string $documentFileId, array $data = null)
72
    {
73
        $this->type = self::TYPE_DOCUMENT;
74
        $this->id = $id;
75
        $this->title = $title;
76
        $this->documentFileId = $documentFileId;
77
        if ($data) {
78
            $this->fill($data);
79
        }
80
    }
81
}
82