Completed
Push — master ( 8985cd...182148 )
by Camilo
06:32
created

Close   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A bindToObject() 0 4 1
A getMandatoryFields() 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\TelegramResponse;
11
use unreal4u\TelegramAPI\Telegram\Types\Custom\ResultBoolean;
12
13
/**
14
 * Use this method to close the bot instance before moving it from one local server to another. You need to delete the
15
 * webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will
16
 * return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters.
17
 *
18
 * Objects defined as-is november 2020
19
 *
20
 * @see https://core.telegram.org/bots/api#logout
21
 */
22
class Close extends TelegramMethods
23
{
24
    public static function bindToObject(TelegramResponse $data, LoggerInterface $logger): TelegramTypes
25
    {
26
        return new ResultBoolean($data->getResultBoolean(), $logger);
27
    }
28
29
    public function getMandatoryFields(): array
30
    {
31
        return [];
32
    }
33
}
34