Do you like this library? Leave a ★ or run composer global require symfony/thanks && composer thanks
to say thank you to all libraries you use in your current project, this included!
Represents a currency value. Offers some helping methods to manage currencies.
Extends Currency in sebastianbergman/money.
// vendor/sebastian/money/src/CurrencyExchangeRate.php
/**
* Required parameters are:
*
* - From: The Currency in which the amount is;
* - To: The Currency in which the amount is converted/exchanged;
* - ExchangeRate: The rate of the exchanging/conversion.
*
* @param array $values
*/
public function __construct(array $values)
See the working example: examples/CurrencyExchangeRate.php.
use Money\Currency;
use SerendipityHQ\Component\ValueObjects\CurrencyExchangeRate\CurrencyExchangeRate;
use SerendipityHQ\Component\ValueObjects\CurrencyExchangeRate\CurrencyExchangeRateInterface;
$values = [
CurrencyExchangeRateInterface::FROM => new Currency('EUR'),
CurrencyExchangeRateInterface::TO => new Currency('USD'),
CurrencyExchangeRateInterface::EXCHANGE_RATE => 1.1174,
CurrencyExchangeRateInterface::EXCHANGE_RATE_DATE => new \DateTime()
];
$currencyExchangeRate = new CurrencyExchangeRate($values);
dump($currencyExchangeRate);
Do you like this library? Leave a ★ or run composer global require symfony/thanks && composer thanks
to say thank you to all libraries you use in your current project, this included!