From cd84917d8f8dda1469a92139c9f1a447c026e491 Mon Sep 17 00:00:00 2001 From: netkas Date: Sat, 5 Oct 2024 00:32:01 -0400 Subject: [PATCH] Updated MessageAutoDeleteTimerChanged --- .../Objects/MessageAutoDeleteTimerChanged.php | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/TgBotLib/Objects/MessageAutoDeleteTimerChanged.php b/src/TgBotLib/Objects/MessageAutoDeleteTimerChanged.php index 99279eb..2b9aaee 100644 --- a/src/TgBotLib/Objects/MessageAutoDeleteTimerChanged.php +++ b/src/TgBotLib/Objects/MessageAutoDeleteTimerChanged.php @@ -7,10 +7,7 @@ class MessageAutoDeleteTimerChanged implements ObjectTypeInterface { - /** - * @var int - */ - private $message_auto_delete_time; + private int $message_auto_delete_time; /** * @return int @@ -21,9 +18,7 @@ } /** - * Returns an array representation of the object. - * - * @return array + * @inheritDoc */ public function toArray(): array { @@ -33,15 +28,16 @@ } /** - * Constructs the object from an array representation. - * - * @param array $data - * @return MessageAutoDeleteTimerChanged + * @inheritDoc */ - public static function fromArray(array $data): self + public static function fromArray(?array $data): ?MessageAutoDeleteTimerChanged { - $object = new self(); + if($data === null) + { + return null; + } + $object = new self(); $object->message_auto_delete_time = $data['message_auto_delete_time']; return $object;