- Added generateArray method for Enums
This commit is contained in:
parent
2d6f2c665b
commit
0550036fd9
@ -13,4 +13,11 @@ enum MethodEnum : string
|
||||
case Post = "POST"; # https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST )
|
||||
case Put = "PUT"; # https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT )
|
||||
case Trace = "TRACE"; # https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/TRACE )
|
||||
|
||||
public static function generateArray() : array
|
||||
{
|
||||
$values = array_map(fn($e) => $e->value, MethodEnum::cases());
|
||||
|
||||
return array_combine($values, $values);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user