Extend transformable string representations of MDGender

This commit is contained in:
2026-05-04 10:15:38 +02:00
parent 28ca68d0d7
commit 49ebf6fd63
+4
View File
@@ -26,10 +26,14 @@ enum MDGender implements MDValueEnumInterface, JsonSerializable {
public static function fromString(string $input):MDGender { public static function fromString(string $input):MDGender {
return match($input) { return match($input) {
"0",
"" => self::none, "" => self::none,
"none" => self::none, "none" => self::none,
"1",
"female" => self::female, "female" => self::female,
"2",
"male" => self::male, "male" => self::male,
"3",
"other" => self::other, "other" => self::other,
default => throw new MDpageParameterNotFromListException("Unknown gender"), default => throw new MDpageParameterNotFromListException("Unknown gender"),
}; };