| Total Complexity | 6 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class GetChatStatisticsUrl extends TdFunction |
||
| 15 | { |
||
| 16 | public const TYPE_NAME = 'getChatStatisticsUrl'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Chat identifier. |
||
| 20 | */ |
||
| 21 | protected int $chatId; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Parameters from "tg://statsrefresh?params=******" link. |
||
| 25 | */ |
||
| 26 | protected string $parameters; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Pass true if a URL with the dark theme must be returned. |
||
| 30 | */ |
||
| 31 | protected bool $isDark; |
||
| 32 | |||
| 33 | public function __construct(int $chatId, string $parameters, bool $isDark) |
||
| 34 | { |
||
| 35 | $this->chatId = $chatId; |
||
| 36 | $this->parameters = $parameters; |
||
| 37 | $this->isDark = $isDark; |
||
| 38 | } |
||
| 39 | |||
| 40 | public static function fromArray(array $array): GetChatStatisticsUrl |
||
| 41 | { |
||
| 42 | return new static( |
||
| 43 | $array['chat_id'], |
||
| 44 | $array['parameters'], |
||
| 45 | $array['is_dark'], |
||
| 46 | ); |
||
| 47 | } |
||
| 48 | |||
| 49 | public function typeSerialize(): array |
||
| 50 | { |
||
| 51 | return [ |
||
| 52 | '@type' => static::TYPE_NAME, |
||
| 53 | 'chat_id' => $this->chatId, |
||
| 54 | 'parameters' => $this->parameters, |
||
| 55 | 'is_dark' => $this->isDark, |
||
| 56 | ]; |
||
| 57 | } |
||
| 58 | |||
| 59 | public function getChatId(): int |
||
| 62 | } |
||
| 63 | |||
| 64 | public function getParameters(): string |
||
| 67 | } |
||
| 68 | |||
| 69 | public function getIsDark(): bool |
||
| 72 | } |
||
| 73 | } |
||
| 74 |