Sets the MaximumLength value.

@param int $maximumLength

@return $this
@throws \Xloit\Bridge\Zend\Validator\Exception\InvalidArgumentException
977299
public function setMaximumLength($maximumLength)
    {
        if ($maximumLength <= $this->minimalLength) {
            throw new Exception\InvalidArgumentException('Maximum length must be larger than minimal length.');
        }

        $this->maximumLength = $maximumLength;

        return $this;
    }
447240
public function setAllowedMaxSize(float $allowed_max_size) {
        if(!$this->setModified('allowed_max_size', $allowed_max_size)->isModified()) {
            return $this;
        }
		$this->allowed_max_size = $allowed_max_size;
		return $this;
    }
1188849
public function validateMinLength($length)
    {
        $this->validator_attributes[] = 'data-parsley-minlength="' . (int)$length . '"';

        $this->validator_checks['min_length'] = (int)$length;

        return $this;
    }
131146
public function setImageWidth($minwidth, $maxwidth)
    {
        $this->setImageMin($minwidth, $this->_minheight);
        $this->setImageMax($maxwidth, $this->_maxheight);
        return $this;
    }
1186144
public static function longAttributeName(Input $definition, int $maxLength): self
    {
        return self::longAttributeParameter($definition, $maxLength, "name");
    }
744153
public function setMaxStateLength(int $maxStateLength = null): self
    {
        assert($maxStateLength === null || $maxStateLength > 0);

        $this->maxStateLength = $maxStateLength;

        return $this;
    }
1010473
protected function setMaxLength(Field & $field, $length)
    {
        if (($value = intval($length)) > 0) {
            $field->validationRules[] = sprintf('max:%s', $value);
            $field->methodParams[] = $value;
        }

        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;
    }
977068
public function maxLength()
    {
        if ($this->maxLength === null) {
            $this->maxLength = $this->defaultMaxLength();
        }

        return $this->maxLength;
    }
587881
public function visitMaximumLengthConstraint(StringValue\MaximumLengthConstraint $constraint)
    {
        $value = $this->currentValue();
        if (
            !$value instanceof Value\StringValue ||
            mb_strlen($value->value(), 'UTF-8') <= $constraint->maximum()
        ) {
            return $this->createResult();
        }

        return $this->createSingleIssueResult($constraint);
    }
590748
public function setMax(int $max): void{
        if($this->min > $max){
            throw new \InvalidArgumentException();
        }

        $this->max  = $max;
    }
1253463
public function setMaxLength(string $maxLength)
    {
        $this->getTag()->setAttribute('maxlength', $maxLength);
        $this->removeValidators(StringValidator::class);

        if ($maxLength !== '') {
            $validator = new StringValidator(0, (int) $maxLength);
            $this->addValidator($validator);
        }

        return $this;
    }
1117955
public function setMaxDepth($maxDepth)
    {
        if (1 === func_num_args() || func_get_arg(1)) {
            @trigger_error(sprintf('%s is deprecated since version 2.1 and will be removed in 3.0. Use %s::enableMaxDepth() and %s::disableMaxDepth() instead.', __METHOD__, __CLASS__, __CLASS__), E_USER_DEPRECATED);
        }
        $this->maxDepth = $maxDepth;

        return $this;
    }
165183
private function maxLength()
	{
		$max = mb_strlen($this->value);
		if (!$ret = $max <= $this->options->max) {
			$this->error(1);
		}

		return $ret;
	}
105842
public function setMaxRedirect($maxRedirect)
    {
        $maxRedirect = intval($maxRedirect);
        if (!empty($maxRedirect)) {
            $this->maxRedirect = $maxRedirect;
        }
    }
483675
public function withMaxLength(int $length): self
    {
        $obj = clone $this;
        $obj->_maxLength = $length;
        return $obj;
    }
168006
public function setMax(int $value)
    {
        $this->max = $value;

        $this->addValidationRule('max:' . $value);

        return $this;
    }