Passed
Pull Request — develop (#1229)
by
unknown
02:50
created

BotCommandScopeChatMember::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
4
namespace Longman\TelegramBot\Entities\BotCommandScope;
5
6
7
use Longman\TelegramBot\Entities\Entity;
8
9
/**
10
 * Class BotCommandScopeChatMember
11
 *
12
 * @link https://core.telegram.org/bots/api#botcommandscopechatmember
13
 *
14
 * <code>
15
 * $data = [
16
 *   'chat_id' => '123456',
17
 *   'user_id' => 987654,
18
 * ];
19
 * </code>
20
 *
21
 * @method string getType()   Scope type, must be chat_member
22
 * @method string getChatId() Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
23
 * @method int    getUserId() Unique identifier of the target user
24
 *
25
 * @method $this setChatId(string $chat_id) Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
26
 * @method $this setUserId(int $user_id)    Unique identifier of the target user
27
 */
28
class BotCommandScopeChatMember extends Entity implements BotCommandScope
29
{
30
    public function __construct(array $data)
31
    {
32
        $data['type'] = 'chat_member';
33
        parent::__construct($data);
34
    }
35
}
36