Dumplie\SharedKernel\Domain\Money\Price::__construct PHP Method

__construct() public method

public __construct ( integer $amount, string $currency, integer $precision = self::DEFAULT_PRECISION )
$amount integer Amount, expressed in the smallest units of $currency (eg cents)
$currency string
$precision integer used to calculate float value, 10000 cents / 100 = 100.00
    public function __construct(int $amount, string $currency, int $precision = self::DEFAULT_PRECISION)
    {
        if ($amount < 0) {
            throw InvalidArgumentException::negativePriceAmount($amount);
        }
        if ($precision < 0) {
            throw InvalidArgumentException::negativePricePrecision($precision);
        }
        if (!Currencies::isValid($currency)) {
            throw InvalidArgumentException::invalidCurrency($currency);
        }
        $this->amount = $amount;
        $this->currency = $currency;
        $this->precision = $precision;
    }