diff --git a/src/TgBotLib/Objects/ForumTopic.php b/src/TgBotLib/Objects/ForumTopic.php index 30b8bca..cf2b6ec 100644 --- a/src/TgBotLib/Objects/ForumTopic.php +++ b/src/TgBotLib/Objects/ForumTopic.php @@ -7,25 +7,10 @@ class ForumTopic implements ObjectTypeInterface { - /** - * @var int - */ - private $message_thread_id; - - /** - * @var string - */ - private $name; - - /** - * @var int - */ - private $icon_color; - - /** - * @var string|null - */ - private $icon_custom_emoji_id; + private int $message_thread_id; + private string $name; + private int $icon_color; + private ?string $icon_custom_emoji_id; /** * Unique identifier of the forum topic @@ -68,9 +53,7 @@ } /** - * Returns an array representation of the object - * - * @return array + * @inheritDoc */ public function toArray(): array { @@ -83,15 +66,16 @@ } /** - * Constructs object from an array representation - * - * @param array $data - * @return ForumTopic + * @inheritDoc */ - public static function fromArray(array $data): self + public static function fromArray(?array $data): ?ForumTopic { - $object = new self(); + if($data === null) + { + return null; + } + $object = new self(); $object->message_thread_id = $data['message_thread_id'] ?? null; $object->name = $data['name'] ?? null; $object->icon_color = $data['icon_color'] ?? null;