1 | <?php |
||
13 | class EcbClient implements EcbClientInterface |
||
14 | { |
||
15 | /** |
||
16 | * @const string |
||
17 | */ |
||
18 | const DEFAULT_EXCHANGE_RATES_URL = 'https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'; |
||
19 | |||
20 | /** |
||
21 | * @var Client |
||
22 | */ |
||
23 | private $client; |
||
24 | |||
25 | /** |
||
26 | * @var CacheInterface |
||
27 | */ |
||
28 | private $cache; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private $exchangeRatesUrl; |
||
34 | |||
35 | /** |
||
36 | * @param string $exchangeRatesUrl |
||
37 | * @param CacheInterface $cache |
||
38 | */ |
||
39 | public function __construct(string $exchangeRatesUrl = self::DEFAULT_EXCHANGE_RATES_URL, CacheInterface $cache = null) |
||
45 | |||
46 | /** |
||
47 | * @throws ExchangeRatesRequestFailedException |
||
48 | * @return ExchangeRate[] |
||
49 | */ |
||
50 | public function getExchangeRates(): array |
||
73 | |||
74 | /** |
||
75 | * @return ResponseInterface |
||
76 | */ |
||
77 | private function performRequest() |
||
82 | |||
83 | } |
||
84 |