public function getRate($fromCurrency, $toCurrency)
    {
        if ($fromCurrency === $toCurrency) {
            return 1;
        }

        $currencyString = "{$fromCurrency}-{$toCurrency}";
        if (!isset($this->rates[$currencyString])) {
            throw new NoExchangeRateException(sprintf(
                'Cannot convert %s to %s, no exchange rate found.',
                $fromCurrency,
                $toCurrency
            ));
        }

        return $this->rates[$currencyString];
    }
public function getRate($fromCurrency, $toCurrency)
    {
        if ($fromCurrency === $toCurrency) {
            return 1;
        }

        $currencyString = "{$fromCurrency}-{$toCurrency}";
        if (!isset($this->rates[$currencyString])) {
            throw new NoExchangeRateException(sprintf(
                'Cannot convert %s to %s, no exchange rate found.',
                $fromCurrency,
                $toCurrency
            ));
        }

        return $this->rates[$currencyString];
    }
public function getRate ( $ fromCurrency , $ toCurrency ) { if ( $ fromCurrency === $ toCurrency ) { return 1 ; } $ currencyString = "{$fromCurrency}-{$toCurrency}" ; if ( ! isset ( $ this -> rates [ $ currencyString ] ) ) { throw new NoExchangeRateException ( sprintf ( 'Cannot convert %s to %s, no exchange rate found.' , $ fromCurrency , $ toCurrency ) ) ; } return $ this -> rates [ $ currencyString ] ; }
Returns the conversion rate between two currencies.

@param string $fromCurrency
@param string $toCurrency

@return float

@throws \Dough\Exception\NoExchangeRateException when the exchanger doesnt
have a rate for the specified currencies.
Returns the conversion rate between two currencies .