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

UnbanChatMember::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\Custom\ResultBoolean;
12
13
/**
14
 * Use this method to unban a previously kicked user in a supergroup. The user will not return to the group
15
 * automatically, but will be able to join via link, etc. The bot must be an administrator in the group for this to
16
 * work. Returns True on success.
17
 *
18
 * Objects defined as-is july 2016
19
 *
20
 * @see https://core.telegram.org/bots/api#unbanchatmember
21
 */
22
class UnbanChatMember extends TelegramMethods
23
{
24
    /**
25
     * Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
26
     * @var string
27
     */
28
    public $chat_id = '';
29
30
    /**
31
     * Unique identifier of the target user
32
     * @var int
33
     */
34
    public $user_id = 0;
35
36
    public static function bindToObject(TelegramRawData $data, LoggerInterface $logger): TelegramTypes
37
    {
38
        return new ResultBoolean($data->getResultBoolean(), $logger);
39
    }
40
41
    public function getMandatoryFields(): array
42
    {
43
        return [
44
            'chat_id',
45
            'user_id',
46
        ];
47
    }
48
}
49