54 lines
1,011 B
PHP
54 lines
1,011 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
|
|
|
/**
|
|
* @method static self veryeasy()
|
|
* @method static self easy()
|
|
* @method static self confirmed()
|
|
* @method static self expert()
|
|
*/
|
|
final class RecipeDifficulty extends BaseEnumRoutable
|
|
{
|
|
/**
|
|
* Enum values
|
|
*
|
|
* @return array
|
|
*/
|
|
protected static function values(): array
|
|
{
|
|
return [
|
|
'veryeasy' => 1,
|
|
'easy' => 2,
|
|
'confirmed' => 3,
|
|
'expert' => 4
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Enum labels
|
|
*
|
|
* @return array
|
|
*/
|
|
protected static function labels(): array
|
|
{
|
|
return [
|
|
'veryeasy' => __('Très facile'),
|
|
'easy' => __('Facile'),
|
|
'confirmed' => __('Confirmé'),
|
|
'expert' => __('Expert'),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Output the value as a string
|
|
*
|
|
* @return string
|
|
*/
|
|
public function __toString(): string
|
|
{
|
|
return (string)$this->label;
|
|
}
|
|
}
|