2023-04-06 13:33:29 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/** @noinspection PhpMissingFieldTypeInspection */
|
|
|
|
|
2024-10-02 00:18:12 -04:00
|
|
|
namespace TgBotLib\Objects;
|
2023-04-06 13:33:29 -04:00
|
|
|
|
|
|
|
use TgBotLib\Interfaces\ObjectTypeInterface;
|
|
|
|
|
|
|
|
class BotDescription implements ObjectTypeInterface
|
|
|
|
{
|
2024-10-04 12:08:31 -04:00
|
|
|
private string $description;
|
2023-04-06 13:33:29 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The bot's short description
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getDescription(): string
|
|
|
|
{
|
|
|
|
return $this->description;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-10-04 12:08:31 -04:00
|
|
|
* @inheritDoc
|
2023-04-06 13:33:29 -04:00
|
|
|
*/
|
|
|
|
public function toArray(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'description' => $this->description,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-10-04 12:08:31 -04:00
|
|
|
* @inheritDoc
|
2023-04-06 13:33:29 -04:00
|
|
|
*/
|
2024-10-04 12:14:32 -04:00
|
|
|
public static function fromArray(?array $data): ?BotDescription
|
2023-04-06 13:33:29 -04:00
|
|
|
{
|
2024-10-04 12:14:32 -04:00
|
|
|
if($data === null)
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-04-06 13:33:29 -04:00
|
|
|
$object = new self();
|
|
|
|
$object->description = $data['description'];
|
|
|
|
|
|
|
|
return $object;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|