. * * @author Daniil Gentili * @copyright 2016-2023 Daniil Gentili * @license https://opensource.org/licenses/AGPL-3.0 AGPLv3 * @link https://docs.madelineproto.xyz MadelineProto documentation */ namespace danog\MadelineProto; /** * Indicates a parsing mode for text. */ 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; } }