2021-02-02 10:26:36 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Enums;
|
|
|
|
|
|
2021-09-03 18:36:44 +02:00
|
|
|
use Kwaadpepper\Enum\BaseEnumRoutable;
|
2021-03-02 14:58:59 +01:00
|
|
|
|
2021-02-02 10:26:36 +01:00
|
|
|
/**
|
|
|
|
|
* @method static self veryeasy()
|
|
|
|
|
* @method static self easy()
|
|
|
|
|
* @method static self confirmed()
|
|
|
|
|
* @method static self expert()
|
|
|
|
|
*/
|
2021-09-03 18:36:44 +02:00
|
|
|
final class RecipeDifficulty extends BaseEnumRoutable
|
2021-02-02 10:26:36 +01:00
|
|
|
{
|
|
|
|
|
protected static function values(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
2021-02-09 18:43:11 +01:00
|
|
|
'veryeasy' => 1,
|
|
|
|
|
'easy' => 2,
|
|
|
|
|
'confirmed' => 3,
|
|
|
|
|
'expert' => 4
|
2021-02-02 10:26:36 +01:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected static function labels(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
2021-02-09 18:43:11 +01:00
|
|
|
'veryeasy' => __('Très facile'),
|
|
|
|
|
'easy' => __('Facile'),
|
|
|
|
|
'confirmed' => __('Confirmé'),
|
2021-02-02 10:26:36 +01:00
|
|
|
'expert' => __('Expert'),
|
|
|
|
|
];
|
|
|
|
|
}
|
2021-02-09 18:43:11 +01:00
|
|
|
|
|
|
|
|
public function __toString(): string
|
|
|
|
|
{
|
2021-03-20 14:38:15 +01:00
|
|
|
return (string)$this->label;
|
2021-02-09 18:43:11 +01:00
|
|
|
}
|
2021-02-02 10:26:36 +01:00
|
|
|
}
|