<?php

declare(strict_types=1);

namespace App\Framework\UserAgent\Enums;

/**
 * Enum representing different browser engine types
 */
enum EngineType: string
{
    case BLINK = 'blink';
    case WEBKIT = 'webkit';
    case GECKO = 'gecko';
    case TRIDENT = 'trident';
    case EDGE_HTML = 'edge_html';
    case UNKNOWN = 'unknown';

    /**
     * Get human-readable name
     */
    public function getDisplayName(): string
    {
        return match ($this) {
            self::BLINK => 'Blink',
            self::WEBKIT => 'WebKit',
            self::GECKO => 'Gecko',
            self::TRIDENT => 'Trident',
            self::EDGE_HTML => 'EdgeHTML',
            self::UNKNOWN => 'Unknown',
        };
    }

    /**
     * Check if engine supports modern web standards
     */
    public function isModern(): bool
    {
        return match ($this) {
            self::BLINK, self::WEBKIT, self::GECKO => true,
            self::TRIDENT, self::EDGE_HTML, self::UNKNOWN => false,
        };
    }

    /**
     * Get engine developer/maintainer
     */
    public function getDeveloper(): string
    {
        return match ($this) {
            self::BLINK => 'Google',
            self::WEBKIT => 'Apple',
            self::GECKO => 'Mozilla',
            self::TRIDENT => 'Microsoft',
            self::EDGE_HTML => 'Microsoft',
            self::UNKNOWN => 'Unknown',
        };
    }
}
