Completed
Push — master ( a4a0d7...5dd6ba )
by Camilo
07:16
created

GetChatMember::getMandatoryFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace unreal4u\TelegramAPI\Telegram\Methods;
6
7
use Psr\Log\LoggerInterface;
8
use unreal4u\TelegramAPI\Abstracts\TelegramMethods;
9
use unreal4u\TelegramAPI\Abstracts\TelegramTypes;
10
use unreal4u\TelegramAPI\InternalFunctionality\TelegramRawData;
11
use unreal4u\TelegramAPI\Telegram\Types\ChatMember;
12
13
/**
14
 * Use this method to get information about a member of a chat. Returns a ChatMember object on success
15
 *
16
 * Objects defined as-is july 2016
17
 *
18
 * @see https://core.telegram.org/bots/api#getchatmember
19
 */
20
class GetChatMember extends TelegramMethods
21
{
22
    /**
23
     * Unique identifier for the target chat or username of the target supergroup or channel (in the format
24
     * @channelusername)
25
     * @var string
26
     */
27
    public $chat_id = '';
28
29
    /**
30
     * Unique identifier of the target user
31
     * @var int
32
     */
33
    public $user_id = 0;
34
35
    public static function bindToObject(TelegramRawData $data, LoggerInterface $logger): TelegramTypes
36
    {
37
        return new ChatMember($data->getResult(), $logger);
38
    }
39
40
    public function getMandatoryFields(): array
41
    {
42
        return [
43
            'chat_id',
44
            'user_id',
45
        ];
46
    }
47
48
}
49