brick / money

A money and currency library for PHP
MIT License
1.61k stars 96 forks source link

ExchangeRateProvider method parameters #58

Open chsagynov opened 2 years ago

chsagynov commented 2 years ago

In the ExchangeRateProvider interface, we have a getExchangeRate(string $sourceCurrencyCode, string $targetCurrencyCode) method. Can we change the parameter type to getExchangeRate(Currency $sourceCurrency, Currency $targetCurrency)? I'm guessing most databases use an int ID rather than a CODE string. In our case, we need to add some unnecessary relationships when fetching from the database. Also, the internal database may use an internal incremental ID instead of the ISO ID.