37 use LegacyEnumShimTrait;
42 public static function fromString(
string $name) : ?
self{
47 static $aliasMap =
null;
49 if($aliasMap ===
null){
51 foreach(self::cases() as $case){
52 foreach($case->getAliases() as $alias){
53 $aliasMap[$alias] = $case;
57 return $aliasMap[mb_strtolower($name)] ??
null;
64 public function getAliases() : array{
66 self::STARTUP => [
"startup"],
67 self::POSTWORLD => [
"postworld"]