Extend transformable string representations of MDGender
This commit is contained in:
@@ -26,10 +26,14 @@ enum MDGender implements MDValueEnumInterface, JsonSerializable {
|
||||
public static function fromString(string $input):MDGender {
|
||||
|
||||
return match($input) {
|
||||
"0",
|
||||
"" => self::none,
|
||||
"none" => self::none,
|
||||
"1",
|
||||
"female" => self::female,
|
||||
"2",
|
||||
"male" => self::male,
|
||||
"3",
|
||||
"other" => self::other,
|
||||
default => throw new MDpageParameterNotFromListException("Unknown gender"),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user