payment1
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user