diff --git a/src/Enum.php b/src/Enum.php index fed2f980..e4bcb8ca 100644 --- a/src/Enum.php +++ b/src/Enum.php @@ -7,4 +7,11 @@ class Enum $constants = $cls->getConstants(); return array_search($constant, $constants); } + + public static function getAll() + { + $cls = new ReflectionClass(get_called_class()); + $constants = $cls->getConstants(); + return array_values($constants); + } }