Completed
Push — master ( 0a69d4...44fef3 )
by Camilo
03:25 queued 01:10
created

GetUserProfilePhotos::bindToObject()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
crap 2
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\UserProfilePhotos;
12
13
/**
14
 * Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
15
 *
16
 * Objects defined as-is july 2016
17
 *
18
 * @see https://core.telegram.org/bots/api#getuserprofilephotos
19
 */
20
class GetUserProfilePhotos extends TelegramMethods
21
{
22
    /**
23
     * Unique identifier of the target user
24
     * @var int
25
     */
26
    public $user_id = 0;
27
28
    /**
29
     * Optional. Sequential number of the first photo to be returned. By default, all photos are returned.
30
     * @var int
31
     */
32
    public $offset = 0;
33
34
    /**
35
     * Optional. Limits the number of photos to be retrieved. Values between 1—100 are accepted. Defaults to 100.
36
     * @var int
37
     */
38
    public $limit = 100;
39
40
    /**
41
     * This call will return an array with updates, so call up a custom type to do this
42
     *
43
     * @param TelegramRawData $data
44
     * @param LoggerInterface $logger
45
     * @return TelegramTypes
46
     */
47
    public static function bindToObject(TelegramRawData $data, LoggerInterface $logger): TelegramTypes
48
    {
49
        return new UserProfilePhotos($data->getResult(), $logger);
50
    }
51
52 1
    public function getMandatoryFields(): array
53
    {
54
        return [
55 1
            'user_id',
56
        ];
57
    }
58
}
59