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

InlineQueryResultArticleType   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 81
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 16
dl 0
loc 81
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 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 InlineQueryResultArticleType.
12
 *
13
 * @see https://core.telegram.org/bots/api#inlinequeryresultarticle
14
 */
15
class InlineQueryResultArticleType extends InlineQueryResultType
16
{
17
    use FillFromArrayTrait;
18
    /**
19
     * Title of the result.
20
     *
21
     * @var string
22
     */
23
    public $title;
24
25
    /**
26
     * Content of the message to be sent.
27
     *
28
     * @var InputMessageContentType
29
     */
30
    public $inputMessageContent;
31
32
    /**
33
     * Optional. URL of the result.
34
     *
35
     * @var string|null
36
     */
37
    public $url;
38
39
    /**
40
     * Optional. Pass True, if you don't want the URL to be shown in the message.
41
     *
42
     * @var bool|null
43
     */
44
    public $hideUrl;
45
46
    /**
47
     * Optional. Short description of the result.
48
     *
49
     * @var string|null
50
     */
51
    public $description;
52
53
    /**
54
     * Optional. Url of the thumbnail for the result.
55
     *
56
     * @var string|null
57
     */
58
    public $thumbUrl;
59
60
    /**
61
     * Optional. Thumbnail width.
62
     *
63
     * @var int|null
64
     */
65
    public $thumbWidth;
66
67
    /**
68
     * Optional. Thumbnail height.
69
     *
70
     * @var int|null
71
     */
72
    public $thumbHeight;
73
74
    /**
75
     * InlineQueryResultArticleType constructor.
76
     *
77
     * @param string                  $id
78
     * @param string                  $title
79
     * @param InputMessageContentType $inputMessageContent
80
     * @param array|null              $data
81
     *
82
     * @throws \Greenplugin\TelegramBot\Exception\BadArgumentException
83
     */
84
    public function __construct(
85
        string $id,
86
        string $title,
87
        InputMessageContentType $inputMessageContent,
88
        array $data = null
89
    ) {
90
        $this->type = self::TYPE_ARTICLE;
91
        $this->id = $id;
92
        $this->title = $title;
93
        $this->inputMessageContent = $inputMessageContent;
94
        if ($data) {
95
            $this->fill($data);
96
        }
97
    }
98
}
99