File: /var/www/vhost/disk-apps/teamdemo.sports-crowd.com/app/Core/ZapSign/DocumentStatusEnum.php
<?php
declare(strict_types=1);
namespace App\Core\ZapSign;
use App\Core\ZapSign\Exceptions\InvalidStatusValueException;
class DocumentStatusEnum
{
private string $value;
const PENDING = "pending";
const SIGNED = "signed";
const REJECTED = "rejected";
const ALLOWED_VALUES = [
self::PENDING,
self::SIGNED,
self::REJECTED
];
public function __construct(string $value)
{
if (!in_array($value, self::ALLOWED_VALUES)) {
throw new InvalidStatusValueException();
}
$this->value = $value;
}
public function value(): string
{
return $this->value;
}
}