Completed
Push — master ( e9be36...9488e8 )
by Camilo
04:57
created

GetChatMember   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 3
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A bindToObject() 0 4 1
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