<?php

declare(strict_types=1);

/*
 * Chill is a software for social workers
 *
 * For the full copyright and license information, please view
 * the LICENSE file that was distributed with this source code.
 */

namespace Chill\TicketBundle\Entity;

/**
 * Represents the emergency status of a ticket (yes or no).
 */
enum EmergencyStatusEnum: string
{
    case YES = 'yes';
    case NO = 'no';

    public static function fromValue(string $value): EmergencyStatusEnum
    {
        return match ($value) {
            self::YES->value => self::YES,
            self::NO->value => self::NO,
            default => throw new \InvalidArgumentException(sprintf('Value "%s" is not valid', $value)),
        };
    }
}
