Completed
Push — master ( 5e4939...d9a3d5 )
by Camilo
01:45
created

GetMyCommands   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 0
cts 4
cp 0
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\BotCommandArray;
12
13
/**
14
 * Use this method to get the current list of the bot's commands. Requires no parameters. Returns Array of BotCommand on
15
 * success.
16
 *
17
 * Objects defined as-is June 2020, Bot API v4.9
18
 *
19
 * @see https://core.telegram.org/bots/api#getmycommands
20
 */
21
class GetMyCommands extends TelegramMethods
22
{
23
    public static function bindToObject(TelegramResponse $data, LoggerInterface $logger): TelegramTypes
24
    {
25
        return new BotCommandArray($data->getResult(), $logger);
26
    }
27
28
    public function getMandatoryFields(): array
29
    {
30
        return [];
31
    }
32
}
33