From 54f78584943a17b9e636c1609a9daf7483b651a1 Mon Sep 17 00:00:00 2001 From: Mahdi Date: Mon, 2 Dec 2024 20:44:14 +0330 Subject: [PATCH] Remove fromString as it doesn't needed --- src/MTProtoTools/UpdateHandler.php | 2 +- src/ParseMode.php | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/MTProtoTools/UpdateHandler.php b/src/MTProtoTools/UpdateHandler.php index 3bc47fa3f..7d4e2c273 100644 --- a/src/MTProtoTools/UpdateHandler.php +++ b/src/MTProtoTools/UpdateHandler.php @@ -717,7 +717,7 @@ trait UpdateHandler $message['action']['message']['text'], MessageEntity::fromRawEntities($message['action']['message']['entities']), isset($message['action']['message']['parse_mode']) ? - ParseMode::fromString($message['action']['message']['parse_mode']) + ParseMode::from($message['action']['message']['parse_mode']) : null ) : null, $message['action']['convert_stars'], diff --git a/src/ParseMode.php b/src/ParseMode.php index 1391abf18..cd1dd39fd 100644 --- a/src/ParseMode.php +++ b/src/ParseMode.php @@ -24,14 +24,4 @@ enum ParseMode: string case HTML = 'HTML'; case MARKDOWN = 'Markdown'; case TEXT = 'text'; - /** @internal */ - public static function fromString(string $mode): ?string - { - foreach (self::cases() as $case) { - if(strtoupper($mode) === $case->name) { - return $case->value; - } - } - return null; - } -} +} \ No newline at end of file