You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
333 B
25 lines
333 B
3 weeks ago
|
<?php
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
namespace App\Dictionary\Custom;
|
||
|
|
||
|
enum Code: int
|
||
|
{
|
||
|
case SUCCESS = 0;
|
||
|
|
||
|
case ERROR = 1;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Label string
|
||
|
*/
|
||
|
public function label(): string
|
||
|
{
|
||
|
return match ($this) {
|
||
|
self::SUCCESS => '成功',
|
||
|
self::ERROR => '失败',
|
||
|
};
|
||
|
}
|
||
|
}
|