Renamed thumb field in TgBotLib\Objects\Telegram > Document to thumbnail

https://git.n64.cc/nosial/libs/tgbot/-/issues/2
This commit is contained in:
Netkas 2023-04-10 19:06:19 -04:00
parent 688ea4f5b1
commit 3ae16b96e1
2 changed files with 6 additions and 5 deletions

View file

@ -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

View file

@ -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;