From 8d074ef36a9cf22d424b6488908ed650f5b7cf64 Mon Sep 17 00:00:00 2001 From: netkas Date: Fri, 4 Oct 2024 21:15:28 -0400 Subject: [PATCH] Updated ForumTopicEdited --- src/TgBotLib/Objects/ForumTopicEdited.php | 28 ++++++++--------------- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/src/TgBotLib/Objects/ForumTopicEdited.php b/src/TgBotLib/Objects/ForumTopicEdited.php index 825bd87..779a6e2 100644 --- a/src/TgBotLib/Objects/ForumTopicEdited.php +++ b/src/TgBotLib/Objects/ForumTopicEdited.php @@ -7,15 +7,8 @@ class ForumTopicEdited implements ObjectTypeInterface { - /** - * @var string|null - */ - private $name; - - /** - * @var string|null - */ - private $icon_custom_emoji_id; + private ?string $name; + private ?string $icon_custom_emoji_id; /** * Optional. New name of the topic, if it was edited @@ -39,9 +32,7 @@ } /** - * Returns array representation of object - * - * @return array + * @inheritDoc */ public function toArray(): array { @@ -52,15 +43,16 @@ } /** - * Constructs object from an array representation - * - * @param array $data - * @return ForumTopicEdited + * @inheritDoc */ - public static function fromArray(array $data): self + public static function fromArray(?array $data): ?ForumTopicEdited { - $object = new self(); + if($data === null) + { + return null; + } + $object = new self(); $object->name = $data['name'] ?? null; $object->icon_custom_emoji_id = $data['icon_custom_emoji_id'] ?? null;