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

LeaveChat::getMandatoryFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 3
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 for your bot to leave a group, supergroup or channel. Returns True on success
15
 *
16
 * Objects defined as-is july 2016
17
 *
18
 * @see https://core.telegram.org/bots/api#kickchatmember
19
 */
20
class LeaveChat extends TelegramMethods
21
{
22
    /**
23
     * Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
24
     * @var string
25
     */
26
    public $chat_id = '';
27
28
    public static function bindToObject(TelegramRawData $data, LoggerInterface $logger): TelegramTypes
29
    {
30
        return new ResultBoolean($data->getResultBoolean(), $logger);
31
    }
32
33
    public function getMandatoryFields(): array
34
    {
35
        return [
36
            'chat_id',
37
        ];
38
    }
39
}
40