From dfbe46443fd9a319dad936afdd9925778ac2fd01 Mon Sep 17 00:00:00 2001 From: Netkas Date: Mon, 13 Feb 2023 13:46:53 -0500 Subject: [PATCH] Added \TgBotLib\Objects > KeyboardButtonPollType --- .../Objects/KeyboardButtonPollType.php | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/TgBotLib/Objects/KeyboardButtonPollType.php diff --git a/src/TgBotLib/Objects/KeyboardButtonPollType.php b/src/TgBotLib/Objects/KeyboardButtonPollType.php new file mode 100644 index 0000000..da48a54 --- /dev/null +++ b/src/TgBotLib/Objects/KeyboardButtonPollType.php @@ -0,0 +1,50 @@ +type; + } + + /** + * Returns an array representation of the object + * + * @return null[]|string[] + */ + public function toArray(): array + { + return [ + 'type' => $this->type, + ]; + } + + /** + * Constructs the object from an array representation + * + * @param array $data + * @return ObjectTypeInterface + */ + public static function fromArray(array $data): ObjectTypeInterface + { + $object = new self(); + $object->type = @$data['type'] ?? null; + return $object; + } + } \ No newline at end of file