File: /var/www/vhost/disk-apps/demo.sports-crowd.com/app/Core/Ticket/TicketNotificationEnum.php
<?php
declare(strict_types=1);
namespace App\Core\Ticket;
use App\Core\Ticket\Exceptions\InvalidValueException;
class TicketNotificationEnum
{
private string $value;
const PENDING = "pending";
const COMPLETED = "completed";
const BILLING_COMPLETED = "billing_completed";
const NOTIFICATION_COMPLETED = "notificacion_completed";
const SKIP = "skip";
const ALLOWED_VALUES = [
self::PENDING,
self::COMPLETED,
self::BILLING_COMPLETED,
self::NOTIFICATION_COMPLETED,
self::SKIP
];
public function __construct(string $value)
{
if (!in_array($value, self::ALLOWED_VALUES)) {
throw new InvalidValueException();
}
$this->value = $value;
}
public function value(): string
{
return $this->value;
}
}