Completed
Pull Request — master (#55)
by Rick
03:55 queued 01:59
created

GetMe::bindToObject()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 2
crap 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\User;
12
13
/**
14
 * A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot in
15
 * form of a User object.
16
 *
17
 * Objects defined as-is july 2016
18
 *
19
 * @see https://core.telegram.org/bots/api#getme
20
 */
21
class GetMe extends TelegramMethods
22
{
23 1
    public static function bindToObject(TelegramResponse $data, LoggerInterface $logger): TelegramTypes
24
    {
25 1
        return new User($data->getResult(), $logger);
26
    }
27
28 2
    public function getMandatoryFields(): array
29
    {
30 2
        return [];
31
    }
32
}
33