Money\Currency::equals PHP Method

equals() public method

Checks whether this currency is the same as an other
public equals ( Currency $other ) : boolean
$other Currency
return boolean
    public function equals(Currency $other)
    {
        return $this->code === $other->code;
    }

Usage Example

 /**
  * @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()];
 }
All Usage Examples Of Money\Currency::equals