UserProfilePhotos::setTotalCount()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
cc 2
nc 2
nop 1
crap 2
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
    protected static $requiredParams = ['total_count', 'photos'];
23
24
    /**
25
     * {@inheritdoc}
26
     *
27
     * @var array
28
     */
29
    protected static $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 int
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
     * @return void
61
     */
62 3
    public function setPhotos($photos)
63 3
    {
64
        $this->photos = $photos;
65
    }
66
67
    /**
68 1
     * @return int
69
     */
70 1
    public function getTotalCount()
71
    {
72
        return $this->totalCount;
73
    }
74
75
    /**
76
     * @param mixed $totalCount
77
     *
78 4
     * @throws InvalidArgumentException
79
     *
80 4
     * @return void
81 3
     */
82 3
    public function setTotalCount($totalCount)
83 1
    {
84
        if (is_integer($totalCount)) {
85 3
            $this->totalCount = $totalCount;
86
        } else {
87
            throw new InvalidArgumentException();
88
        }
89
    }
90
}
91