From 89c9a004ee1c252d4fcb632ef45f97d3e23511c9 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Tue, 8 Oct 2013 22:59:32 +0200 Subject: [PATCH] Added missing toString() method --- src/Enum.php | 7 +++++++ 1 file changed, 7 insertions(+) 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); + } }