/home/techb158/immovalet.com/vendor/moneyphp/money/src
NameSizeModeActions
Calculator/-0755rm
Currencies/-0755rm
Exception/-0755rm
Exchange/-0755rm
Formatter/-0755rm
Parser/-0755rm
PHPUnit/-0755rm
Calculator.php25540644editdlrm
Converter.php14490644editdlrm
Currencies.php6930644editdlrm
Currency.php15950644editdlrm
CurrencyPair.php33740644editdlrm
Exception.php1690644editdlrm
Exchange.php7120644editdlrm
Money.php159730644editdlrm
MoneyFactory.php91600644editdlrm
MoneyFormatter.php3420644editdlrm
MoneyParser.php4620644editdlrm
Number.php83900644editdlrm
Edit: /home/techb158/immovalet.com/vendor/moneyphp/money/src/CurrencyPair.php (3374B)
counterCurrency = $counterCurrency; $this->baseCurrency = $baseCurrency; $this->conversionRatio = (float) $conversionRatio; } /** * Creates a new Currency Pair based on "EUR/USD 1.2500" form representation. * * @param string $iso String representation of the form "EUR/USD 1.2500" * * @return CurrencyPair * * @throws \InvalidArgumentException Format of $iso is invalid */ public static function createFromIso($iso) { $currency = '([A-Z]{2,3})'; $ratio = "([0-9]*\.?[0-9]+)"; // @see http://www.regular-expressions.info/floatingpoint.html $pattern = '#'.$currency.'/'.$currency.' '.$ratio.'#'; $matches = []; if (!preg_match($pattern, $iso, $matches)) { throw new \InvalidArgumentException( sprintf( 'Cannot create currency pair from ISO string "%s", format of string is invalid', $iso ) ); } return new self(new Currency($matches[1]), new Currency($matches[2]), $matches[3]); } /** * Returns the counter currency. * * @return Currency */ public function getCounterCurrency() { return $this->counterCurrency; } /** * Returns the base currency. * * @return Currency */ public function getBaseCurrency() { return $this->baseCurrency; } /** * Returns the conversion ratio. * * @return float */ public function getConversionRatio() { return $this->conversionRatio; } /** * Checks if an other CurrencyPair has the same parameters as this. * * @param CurrencyPair $other * * @return bool */ public function equals(CurrencyPair $other) { return $this->baseCurrency->equals($other->baseCurrency) && $this->counterCurrency->equals($other->counterCurrency) && $this->conversionRatio === $other->conversionRatio ; } /** * {@inheritdoc} * * @return array */ public function jsonSerialize() { return [ 'baseCurrency' => $this->baseCurrency, 'counterCurrency' => $this->counterCurrency, 'ratio' => $this->conversionRatio, ]; } }