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

InlineQueryResultCachedStickerType   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 9
dl 0
loc 34
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 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 InlineQueryResultCachedStickerType.
12
 *
13
 * @see https://core.telegram.org/bots/api#inlinequeryresultcachedsticker
14
 */
15
class InlineQueryResultCachedStickerType extends InlineQueryResultType
16
{
17
    use FillFromArrayTrait;
18
19
    /**
20
     * A valid file identifier of the sticker.
21
     *
22
     * @var string
23
     */
24
    public $stickerFileId;
25
26
    /**
27
     * Optional. Content of the message to be sent instead of the sticker.
28
     *
29
     * @var InputMessageContentType|null
30
     */
31
    public $inputMessageContent;
32
33
    /**
34
     * InlineQueryResultCachedStickerType constructor.
35
     *
36
     * @param string     $id
37
     * @param string     $stickerFileId
38
     * @param array|null $data
39
     *
40
     * @throws \Greenplugin\TelegramBot\Exception\BadArgumentException
41
     */
42
    public function __construct(string $id, string $stickerFileId, array $data = null)
43
    {
44
        $this->type = self::TYPE_STICKER;
45
        $this->id = $id;
46
        $this->stickerFileId = $stickerFileId;
47
        if ($data) {
48
            $this->fill($data);
49
        }
50
    }
51
}
52