Skip to content

Commit b000059

Browse files
committed
Refactor parseMode
1 parent fa246b5 commit b000059

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Traits/HasSharedLogic.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ public function normal(): static
7777
/**
7878
* Set the parse mode of the message.
7979
*
80-
* @param ParseMode|null $mode The parse mode to use
80+
* @param ParseMode|string $mode The parse mode to use
8181
*/
82-
public function parseMode(?ParseMode $mode = null): static
82+
public function parseMode(ParseMode|string $mode): static
8383
{
84-
$this->payload['parse_mode'] = $mode?->value;
84+
$this->payload['parse_mode'] = ($mode instanceof ParseMode) ? $mode->value : $mode;
8585

8686
return $this;
8787
}

0 commit comments

Comments
 (0)