public function calculateExchangeRate(
        CurrencyInterface $currencyFrom,
        CurrencyInterface $currencyTo
    ) {
        $currencyFromIso = $currencyFrom->getIso();
        $currencyToIso = $currencyTo->getIso();

        if ($currencyFromIso == $currencyToIso) {
            return 1.0;
        }

        return $this
            ->calculateExchangeRateBetweenIsos(
                $currencyFromIso,
                $currencyToIso
            );
    }
public function calculateExchangeRate(
        CurrencyInterface $currencyFrom,
        CurrencyInterface $currencyTo
    ) {
        $currencyFromIso = $currencyFrom->getIso();
        $currencyToIso = $currencyTo->getIso();

        if ($currencyFromIso == $currencyToIso) {
            return 1.0;
        }

        return $this
            ->calculateExchangeRateBetweenIsos(
                $currencyFromIso,
                $currencyToIso
            );
    }
public function calculateExchangeRate ( CurrencyInterface $ currencyFrom , CurrencyInterface $ currencyTo ) { $ currencyFromIso = $ currencyFrom -> getIso ( ) ; $ currencyToIso = $ currencyTo -> getIso ( ) ; if ( $ currencyFromIso == $ currencyToIso ) { return 1.0 ; } return $ this -> calculateExchangeRateBetweenIsos ( $ currencyFromIso , $ currencyToIso ) ; }
Calculates the exchange rate.

@param CurrencyInterface $currencyFrom The currency we are converting from.
@param CurrencyInterface $currencyTo   The currency we are converting to.

@return float

@throws CurrencyNotConvertibleException
Calculates the exchange rate .