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

Sticker   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 48
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A mapSubObjects() 0 9 2
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\Inline\Query\Result\Cached\Photo;
9
10
/**
11
 * This object represents a sticker
12
 *
13
 * Objects defined as-is july 2016
14
 *
15
 * @see https://core.telegram.org/bots/api#sticker
16
 */
17
class Sticker extends TelegramTypes
18
{
19
    /**
20
     * Unique identifier for this file
21
     * @var string
22
     */
23
    public $file_id = '';
24
25
    /**
26
     * Photo width
27
     * @var int
28
     */
29
    public $width = 0;
30
31
    /**
32
     * Photo height
33
     * @var int
34
     */
35
    public $height = 0;
36
37
    /**
38
     * Optional. Sticker thumbnail in .webp or .jpg format
39
     * @var PhotoSize
40
     */
41
    public $thumb = null;
42
43
    /**
44
     * Optional. Emoji associated with the sticker
45
     * @var string
46
     */
47
    public $emoji = '';
48
49
    /**
50
     * Optional. File size
51
     * @var int
52
     */
53
    public $file_size = 0;
54
55 1
    protected function mapSubObjects(string $key, array $data): TelegramTypes
56
    {
57
        switch ($key) {
58 1
            case 'thumb':
59 1
                return new PhotoSize($data, $this->logger);
60
        }
61
62
        return parent::mapSubObjects($key, $data);
63
    }
64
}
65