From fd2f55eb90e14b3873b2e63fd8f188a392c1cbd5 Mon Sep 17 00:00:00 2001 From: netkas Date: Fri, 4 Oct 2024 12:07:43 -0400 Subject: [PATCH] Updated BotCommand --- src/TgBotLib/Objects/BotCommand.php | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/src/TgBotLib/Objects/BotCommand.php b/src/TgBotLib/Objects/BotCommand.php index d051d04..06a6c34 100644 --- a/src/TgBotLib/Objects/BotCommand.php +++ b/src/TgBotLib/Objects/BotCommand.php @@ -8,15 +8,8 @@ class BotCommand implements ObjectTypeInterface { - /** - * @var string - */ - private $command; - - /** - * @var string - */ - private $description; + private string $command; + private string $description; /** * 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 - * - * @return array + * @inheritDoc */ public function toArray(): array { @@ -52,15 +43,11 @@ } /** - * Constructs object from an array representation - * - * @param array $data - * @return BotCommand + * @inheritDoc */ - public static function fromArray(array $data): self + public static function fromArray(?array $data): BotCommand { $object = new self(); - $object->command = $data['command'] ?? null; $object->description = $data['description'] ?? null;