diff --git a/README.md b/README.md index fcb5463..7e97078 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,7 @@ museum-digital. - Licenses - Languages + +## Enums + +As of PHP 8.1, PHP now supports enums. A new folder has been added in /src/enums to gather those types of new entries, that can be better expressed using enums at no direct loss (mainly in listing translated options). diff --git a/src/enums/MDAppTokenSection.php b/src/enums/MDAppTokenSection.php new file mode 100644 index 0000000..5f03be1 --- /dev/null +++ b/src/enums/MDAppTokenSection.php @@ -0,0 +1,34 @@ + + */ +declare(strict_types = 1); + +/** + * Sections of musdb for which alternative output formats are available, + * that can be used with an app token. + */ +enum MDAppTokenSection { + + case webcal; + + /** + * Lists all available names. + * + * @return array + */ + public static function caseNames():array { + + $output = []; + + $cases = self::cases(); + foreach ($cases as $case) { + $output[] = $case->name; + } + + return $output; + + } +}