1 | <?php |
||
19 | class CurrCurr |
||
20 | { |
||
21 | /** |
||
22 | * @var EcbClientInterface |
||
23 | */ |
||
24 | private $client; |
||
25 | |||
26 | /** |
||
27 | * CurrCurr constructor. |
||
28 | * |
||
29 | * @param EcbClientInterface $client The ECB Client to use, leave blank for default ECB Client |
||
30 | */ |
||
31 | public function __construct(EcbClientInterface $client = null) |
||
38 | |||
39 | /** |
||
40 | * Delivers the current exchange rates based on EUR from the ECB. |
||
41 | * |
||
42 | * @throws ExchangeRatesMappingFailedException |
||
43 | * @throws ExchangeRatesRequestFailedException |
||
44 | * @return ExchangeRate[] |
||
45 | */ |
||
46 | public function getExchangeRates(): array |
||
50 | |||
51 | /** |
||
52 | * Delivers the current exchange rates for a specific currency based on EUR from the ECB. |
||
53 | * |
||
54 | * @param string $currencyAbbr The currency to be requested. Use constants from Currency. |
||
55 | * @return ExchangeRate |
||
56 | * @throws ExchangeRatesMappingFailedException |
||
57 | * @throws ExchangeRatesRequestFailedException |
||
58 | * @throws CurrencyNotSupportedException |
||
59 | */ |
||
60 | public function getExchangeRateByCurrency(string $currencyAbbr): ExchangeRate |
||
72 | } |