2026-03-18 15:46:15 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Enums;
|
|
|
|
|
|
|
|
|
|
enum ApprovalStatusEnum: string
|
|
|
|
|
{
|
|
|
|
|
case PENDING = 'pending';
|
|
|
|
|
case APPROVED = 'approved';
|
|
|
|
|
case REJECTED = 'rejected';
|
2026-08-13 00:54:29 +02:00
|
|
|
|
|
|
|
|
public function isDecided(): bool
|
|
|
|
|
{
|
|
|
|
|
return $this !== self::PENDING;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return array<int, string>
|
|
|
|
|
*/
|
|
|
|
|
public static function decidedValues(): array
|
|
|
|
|
{
|
|
|
|
|
return array_values(array_map(
|
|
|
|
|
fn (self $status): string => $status->value,
|
|
|
|
|
array_filter(self::cases(), fn (self $status): bool => $status->isDecided()),
|
|
|
|
|
));
|
|
|
|
|
}
|
2026-03-18 15:46:15 +01:00
|
|
|
}
|