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

SendStickerMethod   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Greenplugin\TelegramBot\Method;
6
7
use Greenplugin\TelegramBot\Method\Traits\FillFromArrayTrait;
8
use Greenplugin\TelegramBot\Method\Traits\SendToChatVariablesTrait;
9
use Greenplugin\TelegramBot\Type\InputFileType;
10
11
/**
12
 * Class SendStickerMethod.
13
 *
14
 * @see https://core.telegram.org/bots/api#sendsticker
15
 */
16
class SendStickerMethod
17
{
18
    use FillFromArrayTrait;
19
    use SendToChatVariablesTrait;
20
21
    /**
22
     * Sticker to send.
23
     * Pass a file_id as String to send a file that exists on the Telegram servers (recommended),
24
     * pass an HTTP URL as a String for Telegram to get a .webp file from the Internet,
25
     * or upload a new one using multipart/form-data.
26
     *
27
     * @var InputFileType|string
28
     */
29
    public $sticker;
30
31
    /**
32
     * SendStickerMethod constructor.
33
     *
34
     * @param int|string           $chatId
35
     * @param InputFileType|string $sticker
36
     * @param array|null           $data
37
     *
38
     * @throws \Greenplugin\TelegramBot\Exception\BadArgumentException
39
     */
40
    public function __construct($chatId, $sticker, array $data = null)
41
    {
42
        $this->chatId = $chatId;
43
        $this->sticker = $sticker;
44
        if ($data) {
45
            $this->fill($data);
46
        }
47
    }
48
}
49