Passed
Pull Request — master (#408)
by Alexander
01:43
created

UserProfilePhotos::getPhotos()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace TelegramBot\Api\Types;
4
5
use TelegramBot\Api\BaseType;
6
use TelegramBot\Api\InvalidArgumentException;
7
use TelegramBot\Api\TypeInterface;
8
9
/**
10
 * Class UserProfilePhotos
11
 * This object represent a user's profile pictures.
12
 *
13
 * @package TelegramBot\Api\Types
14
 */
15
class UserProfilePhotos extends BaseType implements TypeInterface
16
{
17
    /**
18
     * {@inheritdoc}
19
     *
20
     * @var array
21
     */
22
    static protected $requiredParams = ['total_count', 'photos'];
23
24
    /**
25
     * {@inheritdoc}
26
     *
27
     * @var array
28
     */
29
    static protected $map = [
30
        'total_count' => true,
31
        'photos' => ArrayOfArrayOfPhotoSize::class,
32
    ];
33
34
    /**
35
     * Total number of profile pictures the target user has
36
     *
37
     * @var Integer
38
     */
39
    protected $totalCount;
40
41
    /**
42
     * Requested profile pictures (in up to 4 sizes each).
43
     * Array of Array of \TelegramBot\Api\Types\PhotoSize
44
     *
45
     * @var array
46
     */
47
    protected $photos;
48
49
    /**
50
     * @return array
51
     */
52 2
    public function getPhotos()
53
    {
54 2
        return $this->photos;
55
    }
56
57
    /**
58
     * @param array $photos
59
     */
60 3
    public function setPhotos($photos)
61
    {
62 3
        $this->photos = $photos;
63 3
    }
64
65
    /**
66
     * @return int
67
     */
68 1
    public function getTotalCount()
69
    {
70 1
        return $this->totalCount;
71
    }
72
73
    /**
74
     * @param int $totalCount
75
     *
76
     * @throws InvalidArgumentException
77
     */
78 4
    public function setTotalCount($totalCount)
79
    {
80 4
        if (is_integer($totalCount)) {
0 ignored issues
show
introduced by
The condition is_integer($totalCount) is always true.
Loading history...
81 3
            $this->totalCount = $totalCount;
82 3
        } else {
83 1
            throw new InvalidArgumentException();
84
        }
85 3
    }
86
}
87