File: /var/www/vhost/disk-apps/qas.sports-crowd.com/app/Core/Ticket/ConfirmStadiumEnum.php
<?php
declare(strict_types=1);
namespace App\Core\Ticket;
use App\Core\Ticket\Exceptions\InvalidValueException;
class ConfirmStadiumEnum
{
private string $value;
const PENDING = "PENDIENTE";
const CONFIRMED = "CONFIRMADO";
const SYNCHRONIZED = "SINCRONIZADA";
const ALLOWED_VALUES = [
self::PENDING,
self::CONFIRMED,
self::SYNCHRONIZED
];
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;
}
}