fapi-cz/php-client

View on GitHub
src/Fapi/FapiClient/Tools/CountryCurrencyResolver.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php declare(strict_types = 1);

namespace Fapi\FapiClient\Tools;

final class CountryCurrencyResolver
{

    /**
     * @param array<string> $countryCurrencySetting
     */
    public function __construct(private array $countryCurrencySetting)
    {
    }

    public function getCurrencyCode(string $countryCode): string
    {
        return $this->countryCurrencySetting[$countryCode] ?? $this->countryCurrencySetting['*'];
    }

}