1 | <?php |
||
5 | class CurrencyConverter |
||
6 | { |
||
7 | private $fromCurrency; |
||
8 | |||
9 | private $toCurrency; |
||
10 | |||
11 | private $apiKey; |
||
12 | |||
13 | private $apiCaller; |
||
14 | |||
15 | private $rates; |
||
16 | |||
17 | 3 | public function __construct(string $apiKey) |
|
23 | |||
24 | 3 | public function convert(string $fromCurrency, string $toCurrency, $amount) :float |
|
33 | |||
34 | public function getRates(string $fromCurrency, string $toCurrency) :float |
||
38 | |||
39 | 2 | private function calculateValue($rate, $amount) :float |
|
45 | |||
46 | public function setApiCaller(ApiCaller $apiCaller) |
||
50 | |||
51 | 2 | public function setRates(Rates $rates) |
|
55 | } |
||
56 |