File: /var/www/vhost/disk-apps/teamdemo.sports-crowd.com/app/Core/Ticket/TicketOriginEnum.php
<?php
declare(strict_types=1);
namespace App\Core\Ticket;
use App\Core\Ticket\Exceptions\InvalidValueException;
class TicketOriginEnum
{
private string $value;
const WEB = 'web';
const APP = 'app';
const ALLOWED_VALUES = [
self::WEB,
self::APP
];
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;
}
}