GetChatStatisticsGraph   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 20
dl 0
loc 64
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getChatId() 0 3 1
A __construct() 0 5 1
A getToken() 0 3 1
A fromArray() 0 6 1
A typeSerialize() 0 7 1
A getX() 0 3 1
1
<?php
2
3
/**
4
 * This phpFile is auto-generated.
5
 */
6
7
declare(strict_types=1);
8
9
namespace AurimasNiekis\TdLibSchema;
10
11
/**
12
 * Loads asynchronous or zoomed in chat statistics graph.
13
 */
14
class GetChatStatisticsGraph extends TdFunction
15
{
16
    public const TYPE_NAME = 'getChatStatisticsGraph';
17
18
    /**
19
     * Chat identifer.
20
     *
21
     * @var int
22
     */
23
    protected int $chatId;
24
25
    /**
26
     * The token for graph loading.
27
     *
28
     * @var string
29
     */
30
    protected string $token;
31
32
    /**
33
     * X-value for zoomed in graph or 0 otherwise.
34
     *
35
     * @var int
36
     */
37
    protected int $x;
38
39
    public function __construct(int $chatId, string $token, int $x)
40
    {
41
        $this->chatId = $chatId;
42
        $this->token  = $token;
43
        $this->x      = $x;
44
    }
45
46
    public static function fromArray(array $array): GetChatStatisticsGraph
47
    {
48
        return new static(
49
            $array['chat_id'],
50
            $array['token'],
51
            $array['x'],
52
        );
53
    }
54
55
    public function typeSerialize(): array
56
    {
57
        return [
58
            '@type'   => static::TYPE_NAME,
59
            'chat_id' => $this->chatId,
60
            'token'   => $this->token,
61
            'x'       => $this->x,
62
        ];
63
    }
64
65
    public function getChatId(): int
66
    {
67
        return $this->chatId;
68
    }
69
70
    public function getToken(): string
71
    {
72
        return $this->token;
73
    }
74
75
    public function getX(): int
76
    {
77
        return $this->x;
78
    }
79
}
80