<?php

declare(strict_types=1);

namespace App\Framework\Performance;

enum PerformanceCategory: string
{
    case SYSTEM = 'system';
    case DATABASE = 'database';
    case CACHE = 'cache';
    case TEMPLATE = 'template';
    case ROUTING = 'routing';
    case CONTROLLER = 'controller';
    case VIEW = 'view';
    case API = 'api';
    case FILESYSTEM = 'filesystem';
    case SECURITY = 'security';
    case BENCHMARK = 'benchmark';
    case DISCOVERY = 'discovery';
    case CONSOLE = 'console';
    case CUSTOM = 'custom';

    public static function fromString(string $value): self
    {
        return self::tryFrom($value) ?? self::CUSTOM;
    }
}
