Set minLength

@param int $minLength

@throws \Exception
962784
public function setMinLength($minLength)
    {
        if ($this->type !== self::TYPE_STRING) {
            throw new \Exception('minLength can only be set on type "string"');
        }

        $this->minLength = (int) $minLength;
    }
387219
public function setMin($min)
    {
        if (!is_int($min)) {
            throw new \InvalidArgumentException('The attribute min on the class Attribute has to be integer (' . gettype($min) . ('object' === gettype($min) ? ' ' . get_class($min) : '') . ' given).');
        }

        $this->min = $min;

        return $this;
    }
1221946
public function setMinLength(string $elementName, int $minLength, string $errorMessage = null): \IvoPetkov\BearFrameworkAddons\Form\Constraints
    {
        if ($errorMessage === null) {
            $errorMessage = sprintf(__('ivopetkov.form.The length of this field must be atleast %s characters.'), $minLength);
        }
        $this->data[] = ['minLength', $errorMessage, $elementName, $minLength];
        return $this;
    }
1209559
public static function truncate(int $minLength = null, int $maxLength = null)
    {
        if (0 >= $maxLength) {
            throw new \InvalidArgumentException(
                    'Max length must be greater than 0, otherwise truncation doesn\'t make sense'
            );
        }

        $self = new self($minLength, $maxLength);
        $self->allowsTruncate = true;
        return $self;
    }
91593
public function strSession($key, $minLength = 0, $maxLength = false, $default = false)
	{
		return $this->str($this->session($key), $minLength, $maxLength, $default);
	}
260405
public function minlength($len, $message = null)
    {
        $this->setRule(__FUNCTION__, function($val, $args)
                       {
                           return !(strlen(trim($val)) < $args[0]);
                       }, $message, array($len));
        return $this;
    }
1352870
public function betweenLength($min, $max, $msg)
    {
        $this->minLength($min, $msg);
        $this->maxLength($max, $msg);
        return $this;
    }
1139769
public function setCodeLength($value)
    {
        $this->codeLength = filter_var(
            $value,
            FILTER_VALIDATE_INT,
            array(
                'options' => array(
                    'min_range' => self::CODE_LENGTH_DEFAULT,
                    'max_range' => self::CODE_LENGTH_MAX
                )
            )
        );

        if (!$this->codeLength) {
            throw new \Exception('The code length have to be between 6 and 20 included.');
        }

        return $this;
    }
91931
public function betweenlength($minlength, $maxlength, $message = null)
    {
        $message = empty($message) ? self::getDefaultMessage(__FUNCTION__, array($minlength, $maxlength)) : NULL;

        $this->minlength($minlength, $message)->max($maxlength, $message);
        return $this;
    }
1064054
public function length($min, $max = null) {
        if (!$this->_isValid) {
            return $this;
        }
        $length = mb_strlen($this->_unsafeVar, $this->conf['encoding']);
        if ($length < $min || (!is_null($max) && $length > $max)) {
            $this->_isValid = false;
        }
        return $this;
    }
492268
public function minLength($subject, int $min) : bool
    {
        if ($subject === null) {
            return false;
        }
        if ($min < 0) {
            throw new InvalidArgumentException('Arg min[' . $min . '] is not non-negative.');
        }
        return strlen('' . $subject) >= $min;
    }
1117721
public void setMinTokenLength(int minTokenLength)
    {
        if(minTokenLength < 0)
            throw new IllegalArgumentException("Minimum token length must be non negative, not " + minTokenLength);
        if(minTokenLength > maxTokenLength)
            throw new IllegalArgumentException("Minimum token length can not exced the maximum token length");
        this.minTokenLength = minTokenLength;
    }
790155
public function setMin($min)
    {
        $min = (int) $min;

        if ($min < 0) {
            throw new \InvalidArgumentException('Error: Minimum cannot be smaller than zero');
        }
        if ($min > $this->max) {
            // We do not throw an exception but silently adjust the maximum.
            $this->max = $min;
        }

        $this->min = $min;
    }
1289388
public function setLength(int $length) : self
    {
        $this->minLength = $length;
        $this->maxLength = $length;

        return $this;
    }
393815
public function length($min, $max = PHP_INT_MAX)
    {
        return $this->markErrorIf(strlen($this->value) < $min || strlen($this->value) > $max);
    }
508154
public function setMin(string $min)
    {
        $this->doSetMin($min);
        $this->getTag()->setAttribute('min', $min);

        return $this;
    }
1191507
public function setMaxLength($maxLength)
    {
        if ($this->type !== self::TYPE_STRING) {
            throw new \Exception('maxLength can only be set on type "string"');
        }

        $this->maxLength = (int) $maxLength;
    }