<?php

namespace Traits\Enum;

use Helpers\Trad\ITrad;

trait BackStringEnumTrait
{
    /**
     * @return array<string,string>
     */
    public static function getAsAssoc(ITrad $trad): array
    {
        $result = [];
        foreach (self::cases() as $case) {
            $result[$case->name] = $trad->t($case->value);
        }

        return $result;
    }
}
