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

KickChatMemberMethod::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 3
crap 6
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\UserIdVariableTrait;
10
11
/**
12
 * Class KickChatMemberMethod.
13
 *
14
 * @see https://core.telegram.org/bots/api#kickchatmember
15
 */
16
class KickChatMemberMethod
17
{
18
    use FillFromArrayTrait;
19
    use ChatIdVariableTrait;
20
    use UserIdVariableTrait;
21
    /**
22
     * Optional. Date when the user will be unbanned, unix time.
23
     * If user is banned for more than 366 days or less than 30 seconds
24
     * from the current time they are considered to be banned forever.
25
     *
26
     * @var int|null
27
     */
28
    public $untilDate;
29
30
    /**
31
     * KickChatMemberMethod constructor.
32
     *
33
     * @param int|string $chatId
34
     * @param int        $userId
35
     * @param array|null $data
36
     *
37
     * @throws \Greenplugin\TelegramBot\Exception\BadArgumentException
38
     */
39
    public function __construct($chatId, int $userId, array $data = null)
40
    {
41
        $this->chatId = $chatId;
42
        $this->userId = $userId;
43
        if ($data) {
44
            $this->fill($data);
45
        }
46
    }
47
}
48