mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 01:03:13 +08:00
Allow individual real-time updates topics to be enabled
This commit is contained in:
@@ -266,6 +266,22 @@ function enumValues(string $enum): array
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param class-string<BackedEnum> $enum
|
||||
* @return string[]
|
||||
*/
|
||||
function enumNames(string $enum): array
|
||||
{
|
||||
static $cache;
|
||||
if ($cache === null) {
|
||||
$cache = [];
|
||||
}
|
||||
|
||||
return $cache[$enum] ?? (
|
||||
$cache[$enum] = array_map(static fn (BackedEnum $type) => (string) $type->name, $enum::cases())
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param class-string<BackedEnum> $enum
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user