| 1 | <?php |
||
| 5 | final class ExchangeRate implements ExchangeRateInterface |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var CurrencyInterface |
||
| 9 | */ |
||
| 10 | private $sourceCurrency; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var CurrencyInterface |
||
| 14 | */ |
||
| 15 | private $targetCurrency; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var float |
||
| 19 | */ |
||
| 20 | private $ratio; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * ExchangeRate constructor. |
||
| 24 | * @param CurrencyInterface $sourceCurrency |
||
| 25 | * @param CurrencyInterface $targetCurrency |
||
| 26 | * @param float $ratio |
||
| 27 | */ |
||
| 28 | public function __construct( |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @inheritDoc |
||
| 43 | */ |
||
| 44 | public function getRatio(): float |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @inheritDoc |
||
| 51 | */ |
||
| 52 | public function getSourceCurrency(): CurrencyInterface |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @inheritDoc |
||
| 59 | */ |
||
| 60 | public function getTargetCurrency(): CurrencyInterface |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @inheritDoc |
||
| 67 | */ |
||
| 68 | public function swapCurrencies(): ExchangeRateInterface |
||
| 76 | } |
||
| 77 |