From 51a29a3844638378c5b7b04f98e7843660414e37 Mon Sep 17 00:00:00 2001 From: Jonathan Treffler Date: Wed, 30 Oct 2024 04:40:09 +0100 Subject: [PATCH] added resource member enums --- lib/Enum/FromNameEnum.php | 14 ++++++++++++++ lib/Enum/MemberPermissionLevel.php | 10 ++++++++++ lib/Enum/MemberType.php | 11 +++++++++++ 3 files changed, 35 insertions(+) create mode 100644 lib/Enum/FromNameEnum.php create mode 100644 lib/Enum/MemberPermissionLevel.php create mode 100644 lib/Enum/MemberType.php diff --git a/lib/Enum/FromNameEnum.php b/lib/Enum/FromNameEnum.php new file mode 100644 index 0000000..1cccdd7 --- /dev/null +++ b/lib/Enum/FromNameEnum.php @@ -0,0 +1,14 @@ +name ){ + return $status->value; + } + } + throw new \ValueError("$name is not a valid value for enum " . self::class ); + } +} \ No newline at end of file diff --git a/lib/Enum/MemberPermissionLevel.php b/lib/Enum/MemberPermissionLevel.php new file mode 100644 index 0000000..f61e99c --- /dev/null +++ b/lib/Enum/MemberPermissionLevel.php @@ -0,0 +1,10 @@ +