This commit is contained in:
2026-04-10 13:31:15 +08:00
parent 6c59e41b32
commit c092662ebe
56 changed files with 4362 additions and 684 deletions
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace app\Enum;
trait BaseEnum {
public static function toArray(): array
{
return [
];
}
/**
* 获取当前状态的描述文本
*/
public function getDescription(): string
{
return self::toArray()[$this->value];
}
/**
* 安全地从值创建枚举实例
*/
public static function tryFromValue(int $value): ?self
{
return self::tryFrom($value);
}
}