feat: add currency lister

feat: add currency lister

static currency lister
This commit is contained in:
2024-01-16 20:29:04 +01:00
parent 53eeb4b373
commit e89290473b
3 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace App\Service;
interface CurrencyListerInterface
{
/**
* @return string[]
*/
public function getCurrencies(): iterable;
}

View File

@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace App\Service;
/**
* Represents currency lister loaded from configuration
*/
readonly final class StaticCurrencyLister implements CurrencyListerInterface {
/**
* @param String[] $available_currencies
*/
public function __construct(private array $available_currencies) {
}
public function getCurrencies(): iterable
{
return $this->available_currencies;
}
}