Completed
Push — master ( dcfb29...f47acd )
by Camilo
04:11
created

StickerSet::mapSubObjects()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 0
cts 4
cp 0
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 2
crap 6
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\StickerSetArray;
9
10
/**
11
 * This object represents a sticker set
12
 *
13
 * Objects defined as-is july 2017
14
 *
15
 * @see https://core.telegram.org/bots/api#stickerset
16
 */
17
class StickerSet extends TelegramTypes
18
{
19
    /**
20
     * Sticker set name
21
     * @var string
22
     */
23
    public $name = '';
24
25
    /**
26
     * Sticker set title
27
     * @var string
28
     */
29
    public $title = '';
30
31
    /**
32
     * True, if the sticker set contains masks
33
     * @var bool
34
     */
35
    public $is_masks = false;
36
37
    /**
38
     * List of all set stickers
39
     * @var Sticker[]
40
     */
41
    public $stickers = [];
42
43
    protected function mapSubObjects(string $key, array $data): TelegramTypes
44
    {
45
        switch ($key) {
46
            case 'shipping_address':
47
                return new StickerSetArray($data, $this->logger);
48
        }
49
50
        return parent::mapSubObjects($key, $data);
51
    }
52
}
53