/** * @inheritdoc */ public function getFor(Currency $currency) { if ($currency->equals($this->baseCurrency)) { // fixer.io doesn't support same currencies, but we don't want it to break because of just that. $this->exchangeRates[$currency->getName()] = (double) 1; } else { $this->retrieveExchangeRateFor($currency); } return $this->exchangeRates[$currency->getName()]; }
/** * @param \Money\Money $other * @return bool */ public function isSameCurrency(Money $other) { return $this->currency->equals($other->currency); }