Updated BotCommand

This commit is contained in:
netkas 2024-10-04 12:07:43 -04:00
parent 5cddbc44d8
commit fd2f55eb90

View file

@ -8,15 +8,8 @@
class BotCommand implements ObjectTypeInterface class BotCommand implements ObjectTypeInterface
{ {
/** private string $command;
* @var string private string $description;
*/
private $command;
/**
* @var string
*/
private $description;
/** /**
* Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. * Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.
@ -39,9 +32,7 @@
} }
/** /**
* Returns an array representation of the object * @inheritDoc
*
* @return array
*/ */
public function toArray(): array public function toArray(): array
{ {
@ -52,15 +43,11 @@
} }
/** /**
* Constructs object from an array representation * @inheritDoc
*
* @param array $data
* @return BotCommand
*/ */
public static function fromArray(array $data): self public static function fromArray(?array $data): BotCommand
{ {
$object = new self(); $object = new self();
$object->command = $data['command'] ?? null; $object->command = $data['command'] ?? null;
$object->description = $data['description'] ?? null; $object->description = $data['description'] ?? null;