$42 GRAYBYTE WORDPRESS FILE MANAGER $61

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.23
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bravrvjk/itiministry.org/wp-content/plugins/give/vendor/moneyphp/money/src/

HOME
Current File : /home/bravrvjk/itiministry.org/wp-content/plugins/give/vendor/moneyphp/money/src//CurrencyPair.php
<?php

namespace Money;

/**
 * Currency Pair holding a base, a counter currency and a conversion ratio.
 *
 * @author Mathias Verraes
 *
 * @see http://en.wikipedia.org/wiki/Currency_pair
 */
final class CurrencyPair implements \JsonSerializable
{
    /**
     * Currency to convert from.
     *
     * @var Currency
     */
    private $baseCurrency;

    /**
     * Currency to convert to.
     *
     * @var Currency
     */
    private $counterCurrency;

    /**
     * @var float
     */
    private $conversionRatio;

    /**
     * @param float $conversionRatio
     *
     * @throws \InvalidArgumentException If conversion ratio is not numeric
     */
    public function __construct(Currency $baseCurrency, Currency $counterCurrency, $conversionRatio)
    {
        if (!is_numeric($conversionRatio)) {
            throw new \InvalidArgumentException('Conversion ratio must be numeric');
        }

        $this->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.
     *
     * @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,
        ];
    }
}


Current_dir [ WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
Calculator
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
Currencies
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
Exception
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
Exchange
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
Formatter
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
PHPUnit
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
Parser
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
Calculator.php
2.494 KB
12 May 2022 3.49 AM
bravrvjk / bravrvjk
0644
Converter.php
1.256 KB
31 Mar 2025 11.17 PM
bravrvjk / bravrvjk
0644
Currencies.php
0.599 KB
31 Mar 2025 11.17 PM
bravrvjk / bravrvjk
0644
Currency.php
1.507 KB
31 Mar 2025 11.17 PM
bravrvjk / bravrvjk
0644
CurrencyPair.php
3.091 KB
31 Mar 2025 11.17 PM
bravrvjk / bravrvjk
0644
Exception.php
0.165 KB
12 May 2022 3.49 AM
bravrvjk / bravrvjk
0644
Exchange.php
0.613 KB
31 Mar 2025 11.17 PM
bravrvjk / bravrvjk
0644
Money.php
15.165 KB
31 Mar 2025 11.17 PM
bravrvjk / bravrvjk
0644
MoneyFactory.php
8.945 KB
12 May 2022 3.49 AM
bravrvjk / bravrvjk
0644
MoneyFormatter.php
0.301 KB
31 Mar 2025 11.17 PM
bravrvjk / bravrvjk
0644
MoneyParser.php
0.451 KB
12 May 2022 3.49 AM
bravrvjk / bravrvjk
0644
Number.php
8.082 KB
31 Mar 2025 11.17 PM
bravrvjk / bravrvjk
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF