Completed
Push — master ( 7d37a2...fea370 )
by Nikolay
06:21
created

PinChatMessageMethod   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 9
dl 0
loc 29
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\ChatIdVariableTrait;
8
use Greenplugin\TelegramBot\Method\Traits\FillFromArrayTrait;
9
use Greenplugin\TelegramBot\Method\Traits\MessageIdVariableTrait;
10
11
/**
12
 * Class PinChatMessageMethod.
13
 *
14
 * @see https://core.telegram.org/bots/api#pinchatmessage
15
 */
16
class PinChatMessageMethod
17
{
18
    use FillFromArrayTrait;
19
    use ChatIdVariableTrait;
20
    use MessageIdVariableTrait;
21
22
    /**
23
     * Optional. Pass True, if it is not necessary to send a notification to all chat members about the new
24
     * pinned message. Notifications are always disabled in channels.
25
     *
26
     * @var bool|null
27
     */
28
    public $disableNotification;
29
30
    /**
31
     * PinChatMessageMethod constructor.
32
     *
33
     * @param int|string $chatId
34
     * @param int        $messageId
35
     * @param array|null $data
36
     *
37
     * @throws \Greenplugin\TelegramBot\Exception\BadArgumentException
38
     */
39
    public function __construct($chatId, int $messageId, array $data = null)
40
    {
41
        $this->chatId = $chatId;
42
        $this->messageId = $messageId;
43
        if ($data) {
44
            $this->fill($data);
45
        }
46
    }
47
}
48