tgbotlib/src/TgBotLib/Objects/ChatBoostRemoved.php
netkas 32d8e233b8 - Remove nullsafe operator from location property
- Fix user serialization in TransactionPartnerUser
 - Remove null check for stickers in StickerSet
 - Fix nullable operator usage in ShippingQuery toArray method
 - Remove null-safe operator for traveler and watcher
 - Fix null-safe operator in PreCheckoutQuery.php
 - Fix null safe operator usage in PollAnswer.php
 - Refactor null checks in PassportData methods
 - Remove nullsafe operator from chat property
 - Refactor web_app handling in MenuButtonWebApp class
 - Fix conditional assignment in InputMediaVideo
 - Fix null coalescing and array mapping in InputMediaAudio
 - Fix redundant null coalescing in caption_entities mapping
 - Fix parsing of caption_entities field in InlineQueryResultPhoto
 - Fix potential unnecessary null coalescing in caption_entities
 - Fix redundant null coalescence check in reply_markup assignment
 - Fix redundant null coalescing in array_map calls
 - Refactor: remove unnecessary null coalescing operator
 - Fix conditional check for caption_entities assignment
 - Fix handling of input_message_content array conversion
 - Fix potential null pointer issue in InlineQuery class
 - Remove redundant null check in toArray method
 - Fix redundant null coalesce operator in photo mapping
 - Remove null safe operator for origin
 - Fix redundant null coalescing in array_map calls.
 - Fix optional chaining error in ChosenInlineResult.php
 - Remove null-safe operator in toArray() method
 - Fix null safe operator usage in ChatMemberRestricted
 - Fix null-safe operator usage in ChatMemberOwner.php
 - Fix null safe operator usage in ChatMemberMember.php
 - Fix nullable operator usage in ChatMemberLeft class
 - Fix null-safe operator in ChatMemberBanned serialization.
 - Fix user attribute null coalescing in ChatMemberAdministrator
 - Fix null-safe operator usage in ChatLocation conversion
 - Remove null safe operator in toArray() method
 - Fix nullable operator usage in ChatInviteLink serialization
 - Fix potential null pointer issue in ChatBoostSourcePremium.
 - Remove null safe operator in ChatBoostRemoved toArray method
 - Fix 'from' property serialization in CallbackQuery
 - Fix nullable operator usage on chat property
 - Remove redundant type check for associative array
 - Remove deprecated BotOld.php file
2024-11-03 18:19:27 -05:00

85 lines
No EOL
2 KiB
PHP

<?php
namespace TgBotLib\Objects;
use TgBotLib\Interfaces\ObjectTypeInterface;
class ChatBoostRemoved implements ObjectTypeInterface
{
private Chat $chat;
private string $boost_id;
private int $remove_date;
private ChatBoostSource $source;
/**
* Chat which was boosted
*
* @return Chat
*/
public function getChat(): Chat
{
return $this->chat;
}
/**
* Unique identifier of the boost
*
* @return string
*/
public function getBoostId(): string
{
return $this->boost_id;
}
/**
* Point in time (Unix timestamp) when the boost was removed
*
* @return int
*/
public function getRemoveDate(): int
{
return $this->remove_date;
}
/**
* Source of the removed boost
*
* @return ChatBoostSource
*/
public function getSource(): ChatBoostSource
{
return $this->source;
}
/**
* @inheritDoc
*/
public function toArray(): array
{
return [
'chat' => $this->chat->toArray(),
'boost_id' => $this->boost_id,
'remove_date' => $this->remove_date,
'source' => $this->source->toArray(),
];
}
/**
* @inheritDoc
*/
public static function fromArray(?array $data): ?ChatBoostRemoved
{
if($data === null)
{
return null;
}
$object = new self();
$object->chat = isset($data['chat']) ? Chat::fromArray($data['chat']) : null;
$object->boost_id = $data['boost_id'];
$object->remove_date = $data['remove_date'];
$object->source = isset($data['source']) ? ChatBoostSource::fromArray($data['source']) : null;
return $object;
}
}