Total Complexity | 7 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
14 | class UpdateChatChatList extends Update |
||
15 | { |
||
16 | public const TYPE_NAME = 'updateChatChatList'; |
||
17 | |||
18 | /** |
||
19 | * Chat identifier. |
||
20 | */ |
||
21 | protected int $chatId; |
||
22 | |||
23 | /** |
||
24 | * The new chat's chat list; may be null. |
||
25 | */ |
||
26 | protected ?ChatList $chatList; |
||
27 | |||
28 | public function __construct(int $chatId, ?ChatList $chatList) |
||
29 | { |
||
30 | parent::__construct(); |
||
31 | |||
32 | $this->chatId = $chatId; |
||
33 | $this->chatList = $chatList; |
||
34 | } |
||
35 | |||
36 | public static function fromArray(array $array): UpdateChatChatList |
||
37 | { |
||
38 | return new static( |
||
39 | $array['chat_id'], |
||
40 | (isset($array['chat_list']) ? TdSchemaRegistry::fromArray($array['chat_list']) : null), |
||
41 | ); |
||
42 | } |
||
43 | |||
44 | public function typeSerialize(): array |
||
45 | { |
||
46 | return [ |
||
47 | '@type' => static::TYPE_NAME, |
||
48 | 'chat_id' => $this->chatId, |
||
49 | 'chat_list' => (isset($this->chatList) ? $this->chatList : null), |
||
50 | ]; |
||
51 | } |
||
52 | |||
53 | public function getChatId(): int |
||
54 | { |
||
55 | return $this->chatId; |
||
56 | } |
||
57 | |||
58 | public function getChatList(): ?ChatList |
||
61 | } |
||
62 | } |
||
63 |