public static function toArray() { $class = get_called_class(); if (!array_key_exists($class, static::$cache)) { $reflection = new \ReflectionClass($class); static::$cache[$class] = $reflection->getConstants(); } return static::$cache[$class]; }