| 1 | <?php |
||
| 11 | class ExchangeRate |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var \DateTime |
||
| 15 | */ |
||
| 16 | private $date; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | private $currency; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var float |
||
| 25 | */ |
||
| 26 | private $rate; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * ExchangeRate constructor. |
||
| 30 | * |
||
| 31 | * @param string $currency |
||
| 32 | * @param float $rate |
||
| 33 | * @param \DateTime $date |
||
| 34 | */ |
||
| 35 | public function __construct(string $currency, float $rate, \DateTime $date) |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @return string The abbreviation of the currency |
||
| 44 | */ |
||
| 45 | public function getCurrency(): string |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @return float The exchange rate based on EUR |
||
| 52 | */ |
||
| 53 | public function getRate(): float |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @return \DateTime The date on which this exchange rate is valid |
||
| 60 | */ |
||
| 61 | public function getDate(): \DateTime |
||
| 65 | } |