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

PromoteChatMemberMethod::__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 PromoteChatMemberMethod.
13
 */
14
class PromoteChatMemberMethod
15
{
16
    use FillFromArrayTrait;
17
    use ChatIdVariableTrait;
18
    use UserIdVariableTrait;
19
20
    /**
21
     * Optional. Pass True, if the administrator can change chat title, photo and other settings.
22
     *
23
     * @var bool|null
24
     */
25
    public $canChangeInfo;
26
27
    /**
28
     * Optional. Pass True, if the administrator can create channel posts, channels only.
29
     *
30
     * @var bool|null
31
     */
32
    public $canPostMessages;
33
34
    /**
35
     * Optional. Pass True, if the administrator can edit messages of other users and can pin messages, channels only.
36
     *
37
     * @var bool|null
38
     */
39
    public $canEditMessages;
40
41
    /**
42
     * Optional. Pass True, if the administrator can delete messages of other users.
43
     *
44
     * @var bool|null
45
     */
46
    public $canDeleteMessages;
47
48
    /**
49
     * Optional. Pass True, if the administrator can invite new users to the chat.
50
     *
51
     * @var bool|null
52
     */
53
    public $canInviteUsers;
54
55
    /**
56
     * Optional. Pass True, if the administrator can restrict, ban or unban chat members.
57
     *
58
     * @var bool|null
59
     */
60
    public $canRestrictMembers;
61
62
    /**
63
     * Optional. Pass True, if the administrator can pin messages, supergroups only.
64
     *
65
     * @var bool|null
66
     */
67
    public $canPinMessages;
68
69
    /**
70
     * Optional. Pass True, if the administrator can add new administrators with a subset of his own privileges
71
     * or demote administrators that he has promoted, directly or indirectly
72
     * (promoted by administrators that were appointed by him).
73
     *
74
     * @var bool|null
75
     */
76
    public $canPromoteMembers;
77
78
    /**
79
     * PromoteChatMemberMethod constructor.
80
     *
81
     * @param $chatId
82
     * @param $userId
83
     * @param array|null $data
84
     *
85
     * @throws \Greenplugin\TelegramBot\Exception\BadArgumentException
86
     */
87
    public function __construct($chatId, $userId, array $data = null)
88
    {
89
        $this->chatId = $chatId;
90
        $this->userId = $userId;
91
        if ($data) {
92
            $this->fill($data);
93
        }
94
    }
95
}
96