public function getRate($fromCurrency, $toCurrency = null)
    {
        if (null === $toCurrency) {
            $toCurrency = $this->getBaseCurrency();
        }

        $this->checkCurrencies(array($fromCurrency, $toCurrency));

        return $this->exchanger->getRate($fromCurrency, $toCurrency);
    }
public function getRate($fromCurrency, $toCurrency = null)
    {
        if (null === $toCurrency) {
            $toCurrency = $this->getBaseCurrency();
        }

        $this->checkCurrencies(array($fromCurrency, $toCurrency));

        return $this->exchanger->getRate($fromCurrency, $toCurrency);
    }
public function getRate ( $ fromCurrency , $ toCurrency = null ) { if ( null === $ toCurrency ) { $ toCurrency = $ this -> getBaseCurrency ( ) ; } $ this -> checkCurrencies ( array ( $ fromCurrency , $ toCurrency ) ) ; return $ this -> exchanger -> getRate ( $ fromCurrency , $ toCurrency ) ; }
Returns the current exchange rate between 2 currencies.

@param string $fromCurrency
@param string|null $toCurrency

@return float

@throws \Dough\Exception\InvalidCurrencyException when a supplied
currency is unknown.
@throws \InvalidArgumentException when a currency does not exist
or when the supplied currencies do not have an exchange
rate set.
Returns the current exchange rate between 2 currencies .