Completed
Push — master ( 7d37a2...fea370 )
by Nikolay
06:21
created

GetUserProfilePhotosMethod::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 2
crap 2.0625
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Greenplugin\TelegramBot\Method;
6
7
use Greenplugin\TelegramBot\Method\Traits\FillFromArrayTrait;
8
use Greenplugin\TelegramBot\Method\Traits\UserIdVariableTrait;
9
10
/**
11
 * Class GetUserProfilePhotosMethod.
12
 *
13
 * @see https://core.telegram.org/bots/api#getuserprofilephotos
14
 */
15
class GetUserProfilePhotosMethod
16
{
17
    use FillFromArrayTrait;
18
    use UserIdVariableTrait;
19
20
    /**
21
     * Optional. Sequential number of the first photo to be returned. By default, all photos are returned.
22
     *
23
     * @var int|null
24
     */
25
    public $offset;
26
27
    /**
28
     * Limits the number of photos to be retrieved. Values between 1—100 are accepted. Defaults to 100.
29
     *
30
     * @var int|null
31
     */
32
    public $limit;
33
34
    /**
35
     * GetUserProfilePhotosMethod constructor.
36
     *
37
     * @param int        $userId
38
     * @param array|null $data
39
     *
40
     * @throws \Greenplugin\TelegramBot\Exception\BadArgumentException
41
     */
42 3
    public function __construct(int $userId, array $data = null)
43
    {
44 3
        $this->userId = $userId;
45 3
        if ($data) {
46
            $this->fill($data);
47
        }
48 3
    }
49
}
50