Allow individual real-time updates topics to be enabled

This commit is contained in:
Alejandro Celaya
2025-07-03 10:10:06 +02:00
parent 436be1985c
commit fb995f2bea
18 changed files with 137 additions and 13 deletions

View File

@@ -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
*/