InputMessageSticker::getThumbnail()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This phpFile is auto-generated.
5
 */
6
7
declare(strict_types=1);
8
9
namespace PHPTdGram\Schema;
10
11
/**
12
 * A sticker message.
13
 */
14
class InputMessageSticker extends InputMessageContent
15
{
16
    public const TYPE_NAME = 'inputMessageSticker';
17
18
    /**
19
     * Sticker to be sent.
20
     */
21
    protected InputFile $sticker;
22
23
    /**
24
     * Sticker thumbnail, if available.
25
     */
26
    protected InputThumbnail $thumbnail;
27
28
    /**
29
     * Sticker width.
30
     */
31
    protected int $width;
32
33
    /**
34
     * Sticker height.
35
     */
36
    protected int $height;
37
38
    public function __construct(InputFile $sticker, InputThumbnail $thumbnail, int $width, int $height)
39
    {
40
        parent::__construct();
41
42
        $this->sticker   = $sticker;
43
        $this->thumbnail = $thumbnail;
44
        $this->width     = $width;
45
        $this->height    = $height;
46
    }
47
48
    public static function fromArray(array $array): InputMessageSticker
49
    {
50
        return new static(
51
            TdSchemaRegistry::fromArray($array['sticker']),
52
            TdSchemaRegistry::fromArray($array['thumbnail']),
53
            $array['width'],
54
            $array['height'],
55
        );
56
    }
57
58
    public function typeSerialize(): array
59
    {
60
        return [
61
            '@type'     => static::TYPE_NAME,
62
            'sticker'   => $this->sticker->typeSerialize(),
63
            'thumbnail' => $this->thumbnail->typeSerialize(),
64
            'width'     => $this->width,
65
            'height'    => $this->height,
66
        ];
67
    }
68
69
    public function getSticker(): InputFile
70
    {
71
        return $this->sticker;
72
    }
73
74
    public function getThumbnail(): InputThumbnail
75
    {
76
        return $this->thumbnail;
77
    }
78
79
    public function getWidth(): int
80
    {
81
        return $this->width;
82
    }
83
84
    public function getHeight(): int
85
    {
86
        return $this->height;
87
    }
88
}
89