You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
609 B
28 lines
609 B
<?php
|
|
|
|
namespace App\Domains\Account\Enums;
|
|
|
|
use App\Domains\System\Traits\Enum\HasPredicateMethod;
|
|
use App\UI\Enums\Concerns\InteractsWithLabels;
|
|
use App\UI\Enums\Contracts\HasLabel;
|
|
|
|
/*
|
|
* @method bool isMale()
|
|
* @method bool isFemale()
|
|
*/
|
|
enum GenderOption: string implements HasLabel
|
|
{
|
|
use HasPredicateMethod;
|
|
use InteractsWithLabels;
|
|
|
|
case MALE = 'male';
|
|
case FEMALE = 'female';
|
|
|
|
public static function fromLabel($value): self
|
|
{
|
|
return match ($value) {
|
|
self::MALE->label() => self::MALE,
|
|
self::FEMALE->label() => self::FEMALE,
|
|
};
|
|
}
|
|
}
|
|
|