<?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 state of a ticket (open or closed).
 */
enum StateEnum: string
{
    case OPEN = 'open';
    case CLOSED = 'closed';

    public static function fromValue(string $value): self
    {
        return match ($value) {
            'open' => self::OPEN,
            'closed' => self::CLOSED,
            default => throw new \InvalidArgumentException('Invalid state value'),
        };
    }
}
