@param int $amount

@return $this
@throws \InvalidArgumentException
965117
public function setColumns(int $amount)
    {
        if (!$amount) {
            throw new InvalidArgumentException('Columns amount must be set');
        }

        if ($this->columns === $amount) {
            return $this;
        }

        foreach ($this->structure as &$v) {
            if ($this->columns < $amount) {
                // Add rows
                $v += $amount ? array_fill(0, $amount, $this->cell_example) : [];
            } else {
                // Remove rows from the end
                $v = \array_slice($v, 0, $amount);
            }
        }
        unset($v);

        $this->columns = $amount;

        return $this;
    }
362456
public function setCouponAmount(MoneyInterface $amount)
    {
        $this->couponAmount = $amount->getAmount();
        $this->couponCurrency = $amount->getCurrency();

        return $this;
    }
204194
protected function assertAmountFormat($amount)
    {
        if (is_float($amount)) {
            throw new InvalidArgumentException(sprintf('The provided amount "%s" must be a string, not a float.', $amount));
        }
        if (!is_numeric($amount)) {
            throw new InvalidArgumentException(sprintf('The provided amount "%s" must be a valid string.', $amount));
        }
    }
153555
public function validateMin($amount)
    {
        $this->validator_attributes[] = 'data-parsley-min="' . (float)$amount . '"';

        $this->validator_checks['min'] = (float)$amount;

        return $this;
    }
679836
public function init($gateway, $amount, $currency)
    {
        $this->setGateway($gateway);
        $this->setAmount($amount);
        $this->setCurrency($currency);
        return $this;
    }
1357755
public function tax($amount = null)
    {
        if (null === $amount) {
            return $this->tax;
        }

        $this->tax = $amount;

        return $this;
    }
712266
public function random(int $amount = 1)
    {
        $count = $this->count();
        if ($amount > $count) {
            $message = sprintf('Requested %d items with %d items present', $amount, $count);
            throw new DomainException($message);
        }

        $keys = array_rand($this->items, $amount);

        if ($amount === 1) {
            return $this->items[$keys];
        }

        return new static(array_intersect_key($this->items, array_flip($keys)));
    }
224577
function Lighten($amount)
    {
        $floatAmount = (float)$amount;
        if ($floatAmount < 0 || $floatAmount > 1) {
            throw new \InvalidArgumentException('Colors can be only lightened with amounts between 0 and 1');
        }
        $this->r = $this->LightenColor($this->r, $floatAmount);
        $this->g = $this->LightenColor($this->g, $floatAmount);
        $this->b = $this->LightenColor($this->b, $floatAmount);
    }
833158
public function setAmount($amount)
    {
        if (!is_int($amount)) {
            throw new InvalidArgumentException("Integer expected. Amount is always in cents");
        }
        if ($amount <= 0) {
            throw new InvalidArgumentException("Amount must be a positive number");
        }
        $this->parameters['amount'] = $amount;
    }
965965
public function setAmount($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

        if ($this->amount !== $v) {
            $this->amount = $v;
            $this->modifiedColumns[GamecurrencyTableMap::COL_AMOUNT] = true;
        }

        return $this;
    }
796323
public function setAmount($amount)
    {
        if ($amount < 0) {
            throw new TpvException('Amount must be greater than or equal to 0.');
        }

        $amount = $this->convertNumber($amount);
        $amount = intval(strval($amount * 100));

        $this->_setParameters['DS_MERCHANT_AMOUNT'] = $amount;

        return $this;
    }
1166204
public function setNumber($number)
    {
        if (!is_string($number) && !is_null($number)) {
            throw new \InvalidArgumentException(__CLASS__ . ' ' . __METHOD__ . ': Not a string');
        }

        $this->number = $number;

        return $this;
    }
1198569
public function charge($amount, array $options = []): Charge
    {
        $options = array_merge([
            'currency' => $this->preferredCurrency(),
        ], $options);

        $options['amount'] = $amount;

        if (!array_key_exists('source', $options) && $this->stripe_id) {
            $options['customer'] = $this->stripe_id;
        }

        if (!array_key_exists('source', $options) && !array_key_exists('customer', $options)) {
            throw new InvalidArgumentException('No payment source provided.');
        }

        return Charge::create($options, ['api_key' => $this->getStripeKey()]);
    }
333676
public function setQuantity(int $quantity): self
    {
        $this->quantity = $quantity;
        $this->updateTotalPrice();
        $this->updateTotalRetailPrice();

        return $this;
    }
322198
public function skip(int $amount)
    {
        $this->items = array_slice($this->items, $amount);

        return $this;
    }
843324
public function setQuantity($quantity) {
        if (empty($quantity))
            throw new Exception('Quantity must be set and cannot be empty.');

        $this->quantity = trim($quantity);

        return $this;
    }
600027
public function setAmount($amount)
    {
        $effects = $this->unserializeEffects($this->getSerializedEffects());
        $effects['amount'] = \floatval($amount);
        $this->setEffects($effects);

        return $this;
    }