From b0000591a0fe504c760c456b974d3b699e586471 Mon Sep 17 00:00:00 2001 From: Irfaq Syed Date: Thu, 17 Oct 2024 19:51:20 +0530 Subject: [PATCH] Refactor parseMode --- src/Traits/HasSharedLogic.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Traits/HasSharedLogic.php b/src/Traits/HasSharedLogic.php index 8906e63..2747f93 100644 --- a/src/Traits/HasSharedLogic.php +++ b/src/Traits/HasSharedLogic.php @@ -77,11 +77,11 @@ public function normal(): static /** * Set the parse mode of the message. * - * @param ParseMode|null $mode The parse mode to use + * @param ParseMode|string $mode The parse mode to use */ - public function parseMode(?ParseMode $mode = null): static + public function parseMode(ParseMode|string $mode): static { - $this->payload['parse_mode'] = $mode?->value; + $this->payload['parse_mode'] = ($mode instanceof ParseMode) ? $mode->value : $mode; return $this; }