25 lines
482 B
PHP
25 lines
482 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
enum StatusEnum: int
|
|
{
|
|
case CREATED = 1;
|
|
case SENT = 2;
|
|
case DELIVERED = 3;
|
|
|
|
public static function getRange()
|
|
{
|
|
return [StatusEnum::CREATED, StatusEnum::SENT, StatusEnum::DELIVERED];
|
|
}
|
|
|
|
public function description()
|
|
{
|
|
return match ($this){
|
|
self::CREATED => 'Создан',
|
|
self::SENT => 'Отправлен',
|
|
self::DELIVERED => 'Доставлен'
|
|
};
|
|
}
|
|
}
|