PATH:
home
/
lab2454c
/
vaultchip.com
/
vendor
/
moneyphp
/
money
/
src
/
Exchange
<?php namespace Money\Exchange; use Money\Currency; use Money\CurrencyPair; use Money\Exception\UnresolvableCurrencyPairException; use Money\Exchange; /** * Provides a way to get exchange rate from a static list (array). * * @author Frederik Bosch <f.bosch@genkgo.nl> */ final class FixedExchange implements Exchange { /** * @var array */ private $list; /** * @param array $list */ public function __construct(array $list) { $this->list = $list; } /** * {@inheritdoc} */ public function quote(Currency $baseCurrency, Currency $counterCurrency) { if (isset($this->list[$baseCurrency->getCode()][$counterCurrency->getCode()])) { return new CurrencyPair( $baseCurrency, $counterCurrency, $this->list[$baseCurrency->getCode()][$counterCurrency->getCode()] ); } throw UnresolvableCurrencyPairException::createFromCurrencies($baseCurrency, $counterCurrency); } }
[-] IndirectExchange.php
[edit]
[+]
..
[-] ReversedCurrenciesExchange.php
[edit]
[-] SwapExchange.php
[edit]
[-] ExchangerExchange.php
[edit]
[-] FixedExchange.php
[edit]