| 1 | <?php |
||
| 7 | class CurrencyConverter |
||
| 8 | { |
||
| 9 | |||
| 10 | private $url_api = "http://api.fixer.io/latest"; |
||
| 11 | |||
| 12 | private $base; |
||
| 13 | |||
| 14 | private $rates = array(); |
||
| 15 | |||
| 16 | private $client; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * CurrencyConverter constructor. |
||
| 20 | * @param string $base |
||
| 21 | */ |
||
| 22 | public function __construct($base = "USD") |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @param $symbol |
||
| 30 | * @return mixed |
||
| 31 | * @throws \Exception |
||
| 32 | */ |
||
| 33 | public function getRate($symbol) |
||
| 43 | |||
| 44 | /** |
||
| 45 | * |
||
| 46 | */ |
||
| 47 | private function generateRates() |
||
| 58 | } |
||
| 59 |