<?php

namespace App\Enums;

enum MatchOutcome: string
{
    case Home = 'home';
    case Draw = 'draw';
    case Away = 'away';

    public function label(): string
    {
        return match ($this) {
            self::Home => 'Home win',
            self::Draw => 'Draw',
            self::Away => 'Away win',
        };
    }

    /**
     * @return array<string, string>
     */
    public static function options(): array
    {
        $options = [];

        foreach (self::cases() as $case) {
            $options[$case->value] = $case->label();
        }

        return $options;
    }
}
