equals() публичный Метод

Checks whether this currency is the same as an other
public equals ( Currency $other ) : boolean
$other Currency
Результат boolean
 /**
  * @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()];
 }
Пример #2
0
 /**
  * @param \Money\Money $other
  * @return bool
  */
 public function isSameCurrency(Money $other)
 {
     return $this->currency->equals($other->currency);
 }