From 3ae16b96e166f53e5e91c96bfc1b529167851163 Mon Sep 17 00:00:00 2001 From: Netkas Date: Mon, 10 Apr 2023 19:06:19 -0400 Subject: [PATCH] Renamed `thumb` field in `TgBotLib\Objects\Telegram > Document` to `thumbnail` https://git.n64.cc/nosial/libs/tgbot/-/issues/2 --- CHANGELOG.md | 1 + src/TgBotLib/Objects/Telegram/Document.php | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31afc70..725401b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ This update accompanies the release of the [Telegram Bot API 6.6](https://core.t * Added proper construction for `PollOption[]` objects in `TgBotLib\Objects\Telegram > Poll` * Renamed `thumb` field in `TgBotLib\Objects\Telegram > Animation` to `thumbnail` * Renamed `thumb` field in `TgBotLib\Objects\Telegram > Audio` to `thumbnail` + * Renamed `thumb` field in `TgBotLib\Objects\Telegram > Document` to `thumbnail` ## [6.5.2] - 2023-02-26 diff --git a/src/TgBotLib/Objects/Telegram/Document.php b/src/TgBotLib/Objects/Telegram/Document.php index dd68c09..e3bb941 100644 --- a/src/TgBotLib/Objects/Telegram/Document.php +++ b/src/TgBotLib/Objects/Telegram/Document.php @@ -21,7 +21,7 @@ /** * @var PhotoSize|null */ - private $thumb; + private $thumbnail; /** * @var string|null @@ -64,9 +64,9 @@ * * @return PhotoSize|null */ - public function getThumb(): ?PhotoSize + public function getThumbnail(): ?PhotoSize { - return $this->thumb; + return $this->thumbnail; } /** @@ -111,7 +111,7 @@ return [ 'file_id' => $this->file_id ?? null, 'file_unique_id' => $this->file_unique_id ?? null, - 'thumb' => ($this->thumb instanceof ObjectTypeInterface) ? $this->thumb->toArray() : null, + 'thumbnail' => ($this->thumbnail instanceof ObjectTypeInterface) ? $this->thumbnail->toArray() : null, 'file_name' => $this->file_name ?? null, 'mime_type' => $this->mime_type ?? null, 'file_size' => $this->file_size ?? null, @@ -129,7 +129,7 @@ $object = new self(); $object->file_id = $data['file_id'] ?? null; $object->file_unique_id = $data['file_unique_id'] ?? null; - $object->thumb = isset($data['thumb']) ? PhotoSize::fromArray($data['thumb']) : null; + $object->thumbnail = isset($data['thumbnail']) ? PhotoSize::fromArray($data['thumbnail']) : null; $object->file_name = $data['file_name'] ?? null; $object->mime_type = $data['mime_type'] ?? null; $object->file_size = $data['file_size'] ?? null;