Common/Currency/ArrayCurrencyConverter.php
private function addRate($pair, $rate)
    {
        if (!preg_match('~^[A-Z]{3}/[A-Z]{3}$~', $pair)) {
            throw new InvalidArgumentException("Unexpected currency pair '$pair'.");
        }

        if (!(is_float($rate) && 0 < $rate)) {
            throw new InvalidArgumentException("Unexpected rate '$rate'.");
        }

        $this->rates[$pair] = $rate;

        return $this;
    }
private function addRate($pair, $rate)
    {
        if (!preg_match('~^[A-Z]{3}/[A-Z]{3}$~', $pair)) {
            throw new InvalidArgumentException("Unexpected currency pair '$pair'.");
        }

        if (!(is_float($rate) && 0 < $rate)) {
            throw new InvalidArgumentException("Unexpected rate '$rate'.");
        }

        $this->rates[$pair] = $rate;

        return $this;
    }
private function addRate ( $ pair , $ rate ) { if ( ! preg_match ( '~^[A-Z]{3}/[A-Z]{3}$~' , $ pair ) ) { throw new InvalidArgumentException ( "Unexpected currency pair '$pair'." ) ; } if ( ! ( is_float ( $ rate ) && 0 < $ rate ) ) { throw new InvalidArgumentException ( "Unexpected rate '$rate'." ) ; } $ this -> rates [ $ pair ] = $ rate ; return $ this ; }
Adds the conversion rate.

@param string $pair
@param float  $rate

@return ArrayCurrencyConverter
Adds the conversion rate .