<?php

namespace App\Services\Keywords;

use Google\Ads\GoogleAds\V25\Enums\KeywordPlanCompetitionLevelEnum\KeywordPlanCompetitionLevel;

class KeywordCompetitionFormatter
{
    public static function label(mixed $competition): string
    {
        if (! is_int($competition)) {
            return 'UNKNOWN';
        }

        try {
            return KeywordPlanCompetitionLevel::name($competition);
        } catch (\UnexpectedValueException) {
            return 'UNKNOWN';
        }
    }
}
