Completed
Push — master ( e9be36...9488e8 )
by Camilo
04:57
created

UserProfilePhotos   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 23
ccs 2
cts 2
cp 1
rs 10
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace unreal4u\TelegramAPI\Telegram\Types;
6
7
use unreal4u\TelegramAPI\Abstracts\TelegramTypes;
8
use unreal4u\TelegramAPI\Telegram\Types\Custom\UserProfilePhotosArray;
9
10
/**
11
 * This object represent a user's profile pictures.
12
 *
13
 * Objects defined as-is july 2016
14
 *
15
 * @see https://core.telegram.org/bots/api#userprofilephotos
16
 */
17
class UserProfilePhotos extends TelegramTypes
18
{
19
    /**
20
     * Total number of profile pictures the target user has
21
     * @var int
22
     */
23
    public $total_count = 0;
24
25
    /**
26
     * Requested profile pictures (in up to 4 sizes each)
27
     * NOTE: Is an array of an array of PhotoSize objects
28
     *
29
     * @var array
30
     */
31
    public $photos = [];
32
33 3
    protected function mapSubObjects(string $key, array $data): TelegramTypes
34
    {
35
        switch ($key) {
36 3
            case 'photos':
37 3
                return new UserProfilePhotosArray($data, $this->logger);
38
        }
39
40
        return parent::mapSubObjects($key, $data);
41
    }
42
}
43