Completed
Push — draft ( 93e9ee...93a74b )
by Nikolay
02:20
created

KickChatMemberMethod   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 9
dl 0
loc 29
ccs 5
cts 5
cp 1
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\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, \DateTimeInterface.
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 \DateTimeInterface|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 1
    public function __construct($chatId, int $userId, array $data = null)
40
    {
41 1
        $this->chatId = $chatId;
42 1
        $this->userId = $userId;
43 1
        if ($data) {
44 1
            $this->fill($data);
45
        }
46 1
    }
47
}
48