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 {
|
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"),
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user