tgbotlib/src/TgBotLib/Objects/BotDescription.php
2024-10-04 12:14:32 -04:00

49 lines
No EOL
1,007 B
PHP

<?php
/** @noinspection PhpMissingFieldTypeInspection */
namespace TgBotLib\Objects;
use TgBotLib\Interfaces\ObjectTypeInterface;
class BotDescription implements ObjectTypeInterface
{
private string $description;
/**
* The bot's short description
*
* @return string
*/
public function getDescription(): string
{
return $this->description;
}
/**
* @inheritDoc
*/
public function toArray(): array
{
return [
'description' => $this->description,
];
}
/**
* @inheritDoc
*/
public static function fromArray(?array $data): ?BotDescription
{
if($data === null)
{
return null;
}
$object = new self();
$object->description = $data['description'];
return $object;
}
}