Set the cost parameter for bcrypt

@param int $cost
@return $this
@throws \InvalidArgumentException
335346
public function setCost($cost)
    {
        if ($cost < 4 || $cost > 31) {
            throw new \InvalidArgumentException(sprintf("Invalid bcrypt cost parameter specified: %s", $cost));
        }
        $this->cost = $cost;
        return $this;
    }
25871
private static function costHash(string $cost, string $pass): string
    {
        return Str::substr(\hash_hmac(self::ALGO, $cost, $pass, true), 0, 8);
    }
52328
public function setWeight($weight)
    {
        if ($weight < 0.1) {
            throw new InvalidArgumentException("Expected weight greater than 100g.");
        }

        $this->set(Config::T530, (string)round($weight, 2));

        return $this;
    }
322156
public function setBySecond($value)
    {
        if (!is_integer($value) || $value < 0 || $value > 60) {
            throw new \InvalidArgumentException('Invalid value for BYSECOND');
        }

        $this->bySecond = $value;

        $this->canUseBySetPos = true;

        return $this;
    }
1243375
public function setCosts( $price )
	{
		if ( $price == $this->getCosts() ) { return; }

		$this->_checkPrice( $price );

		$this->_values['costs'] = $this->_formatNumber( $price );
		$this->setModified();
	}
1162019
public function setValue($value) {
		if (!$this->isPrimitive($value)) {
			throw new \InvalidArgumentException('Use setValue() only for primitives and PhpConstant, anyway use setExpression() instead.');
		}
		$this->value = $value;
		$this->hasValue = true;

		return $this;
	}
224229
public function setType($type)
    {
        if (!in_array($type, array(
            self::TYPE_CORE,
            self::TYPE_DISTRIBUTION,
            self::TYPE_CAMPAIGN,
            self::TYPE_MILESTONE,
            self::TYPE_ACTIVITY,
            self::TYPE_OPERATION,
            self::TYPE_CHANNEL,
            self::TYPE_LOCATION,
            self::TYPE_SECURITY,
            self::TYPE_REPORT,
            self::TYPE_REPORT_ANALYTICS,
            self::TYPE_REPORT_BUDGET,
            self::TYPE_REPORT_SALES,
            self::TYPE_HOOK,
            self::TYPE_SYMFONY,
        ))) {
            throw new \InvalidArgumentException("Invalid bundle type.");
        }
        $this->type = $type;

        return $this;
    }
677379
public function setRequired($required)
    {
        if (is_bool($required) === true) {
            $this->required = $required;
        } else {
            $msg = "The 'required' argument must be a boolean value, '" . gettype($required) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
1151945
public function setAmount($amount)
    {
        if ($amount === null) {
            $this->amount = 0;
            return $this;
        }
        
        if (!is_int($amount)) {
            throw new InvalidArgumentException(sprintf(
                'Amount must be an integer, "%s" given',
                is_object($amount) ? get_class($amount) : gettype($amount)
            ));
        }
        
        // Overflow check is not necessary because we have an integer
        $this->amount = $amount;
        return $this;
    }
333676
public function setQuantity(int $quantity): self
    {
        $this->quantity = $quantity;
        $this->updateTotalPrice();
        $this->updateTotalRetailPrice();

        return $this;
    }
965630
protected function setX($x)
	{
		if ( ! is_numeric($x) || $x < 0)
		{
			throw new \InvalidArgumentException('The value of x must be a positive numeric.');
		}
		
		$this->x = (int) $x;
		
		return $this;
	}
817270
public function setSmtpSecurity($security)
    {
        $security = strtoupper($security);
        $validSecurity = [ '', 'TLS', 'SSL' ];

        if (!in_array($security, $validSecurity)) {
            throw new InvalidArgumentException(
                'SMTP Security is not valid. Must be "", "TLS" or "SSL".'
            );
        }

        $this->smtpSecurity = $security;

        return $this;
    }
639576
public function setTaxRate($taxRate)
    {

        if (($taxRate > 1)) {
            throw new \InvalidArgumentException('invalid value for $taxRate when calling GetCorporationsCorporationIdOk., must be smaller than or equal to 1.');
        }
        if (($taxRate < 0)) {
            throw new \InvalidArgumentException('invalid value for $taxRate when calling GetCorporationsCorporationIdOk., must be bigger than or equal to 0.');
        }

        $this->container['taxRate'] = $taxRate;

        return $this;
    }
177388
public function setFee($fee)
    {
        NumericValidator::validate($fee, "Fee");
        $fee = Formatter::formatToPrice($fee);
        $this->fee = $fee;
        return $this;
    }
386640
public function setHit($hit)
    {
        if (false === is_bool($hit)) {
            throw InvalidArgumentException::typeMismatch($hit, 'Boolean');
        }

        $this->hit = $hit;

        return $this;
    }
53362
public function getPasswordCost(?int $cost = null) : int
    {
        if ($cost !== null) {
            return $cost;
        }

        /** @var \Illuminate\Contracts\Config\Repository $config */
        $config = $this->config ?? config();

        return $config->get('laranixauth.password.cost', 12);
    }
812626
public function setSSL($isEnabled)
    {
        if (!is_bool($isEnabled)) {
            throw new InvalidArgumentException(
                sprintf('%s only accepts a boolean', __FUNCTION__)
            );
        }

        $this->ssl = (bool)$isEnabled;

        return $this;
    }