53 lines
1.1 KiB
PHP
53 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
use Kwaadpepper\Enum\BaseEnum;
|
|
|
|
/**
|
|
* @method static self noLetter()
|
|
* @method static self aLetter()
|
|
* @method static self bLetter()
|
|
* @method static self cLetter()
|
|
* @method static self dLetter()
|
|
* @method static self eLetter()
|
|
*/
|
|
final class NutriscoreEnum extends BaseEnum
|
|
{
|
|
// @phpcs:ignore Generic.Commenting.Fixme.TaskFound
|
|
// FIXME: faire en sorte de ne pas afficher le nutriscore en front si sa valeur est de 0.
|
|
|
|
/**
|
|
* Enum values
|
|
*
|
|
* @return array
|
|
*/
|
|
protected static function values(): array
|
|
{
|
|
return [
|
|
'noLetter' => 0,
|
|
'aLetter' => 1,
|
|
'bLetter' => 2,
|
|
'cLetter' => 3,
|
|
'dLetter' => 4,
|
|
'eLetter' => 5
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Enum labels
|
|
*
|
|
* @return array
|
|
*/
|
|
protected static function labels(): array
|
|
{
|
|
return [
|
|
'noLetter' => 'Ø',
|
|
'aLetter' => 'A',
|
|
'bLetter' => 'B',
|
|
'cLetter' => 'C',
|
|
'dLetter' => 'D',
|
|
'eLetter' => 'E'
|
|
];
|
|
}
|
|
}
|