GetUserProfilePhotosMethod   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 10
dl 0
loc 38
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 9 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace TgBotApi\BotApiBase\Method;
6
7
use TgBotApi\BotApiBase\Method\Interfaces\MethodInterface;
8
use TgBotApi\BotApiBase\Method\Traits\FillFromArrayTrait;
9
use TgBotApi\BotApiBase\Method\Traits\UserIdVariableTrait;
10
11
/**
12
 * Class GetUserProfilePhotosMethod.
13
 *
14
 * @see https://core.telegram.org/bots/api#getuserprofilephotos
15
 */
16
class GetUserProfilePhotosMethod implements MethodInterface
17
{
18
    use FillFromArrayTrait;
19
    use UserIdVariableTrait;
20
21
    /**
22
     * Optional. Sequential number of the first photo to be returned. By default, all photos are returned.
23
     *
24
     * @var int|null
25
     */
26
    public $offset;
27
28
    /**
29
     * Limits the number of photos to be retrieved. Values between 1—100 are accepted. Defaults to 100.
30
     *
31
     * @var int|null
32
     */
33
    public $limit;
34
35
    /**
36
     * GetUserProfilePhotosMethod constructor.
37
     *
38
     * @param int        $userId
39
     * @param array|null $data
40
     *
41
     * @throws \TgBotApi\BotApiBase\Exception\BadArgumentException
42
     *
43
     * @return GetUserProfilePhotosMethod
44
     */
45 2
    public static function create(int $userId, array $data = null): GetUserProfilePhotosMethod
46
    {
47 2
        $instance = new static();
48 2
        $instance->userId = $userId;
49 2
        if ($data) {
50 1
            $instance->fill($data);
51
        }
52
53 2
        return $instance;
54
    }
55
}
56