| Total Complexity | 5 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class InputMessageGame extends InputMessageContent |
||
| 15 | { |
||
| 16 | public const TYPE_NAME = 'inputMessageGame'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * User identifier of the bot that owns the game. |
||
| 20 | * |
||
| 21 | * @var int |
||
| 22 | */ |
||
| 23 | protected int $botUserId; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Short name of the game. |
||
| 27 | * |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | protected string $gameShortName; |
||
| 31 | |||
| 32 | public function __construct(int $botUserId, string $gameShortName) |
||
| 33 | { |
||
| 34 | parent::__construct(); |
||
| 35 | |||
| 36 | $this->botUserId = $botUserId; |
||
| 37 | $this->gameShortName = $gameShortName; |
||
| 38 | } |
||
| 39 | |||
| 40 | public static function fromArray(array $array): InputMessageGame |
||
| 41 | { |
||
| 42 | return new static( |
||
| 43 | $array['bot_user_id'], |
||
| 44 | $array['game_short_name'], |
||
| 45 | ); |
||
| 46 | } |
||
| 47 | |||
| 48 | public function typeSerialize(): array |
||
| 54 | ]; |
||
| 55 | } |
||
| 56 | |||
| 57 | public function getBotUserId(): int |
||
| 60 | } |
||
| 61 | |||
| 62 | public function getGameShortName(): string |
||
| 65 | } |
||
| 66 | } |
||
| 67 |