Set maximum

@param int $maximum

@throws \Exception
970346
public function setMaximum($maximum)
    {
        if (!\in_array($this->type, [self::TYPE_INTEGER, self::TYPE_NUMBER], true)) {
            throw new \Exception('maximum can only be set on type "integer" or "number');
        }

        $this->maximum = (int) $maximum;
    }
370340
public function setDefaultLimit(int $limit): void
    {
        if ($limit < 1) {
            throw new GridException('Wrong default limit value, should be greater than zero');
        }
        $this->setLimit($limit);

        $this->defaultLimit = $limit;
    }
632288
public function max($max, $message = null)
    {
        $this->set([
            'max' => (int)$max,
        ], $message);
        return $this;
    }
257715
public function setNormalMaximum($normalMaximum)
    {
        if (is_numeric($normalMaximum) || (is_bool($normalMaximum) && $normalMaximum === false)) {
            $this->normalMaximum = $normalMaximum;
        } else {
            $msg = "NormalMaximum must be a number or (boolean) false, '" . gettype($normalMaximum) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
99596
protected function setMaxTokens(?int $maxTokens): self
    {
        assert($maxTokens === null || $maxTokens > 0);

        $this->maxTokens = $maxTokens > 0 ? $maxTokens : null;

        return $this;
    }
1302362
function setLimit($limit) {
		if (null !== $limit) {
			$limit = (int) $limit;
		}
		$this->limit = $limit;
		return $this;
	}
868479
public final void setMax(final int max) {
		if (max < 0) {
			throw new IllegalArgumentException(ILLEGAL_MAX);
		}
		if (max != getMax()) {
			getOrCreateComponentModel().max = max;
		}
	}
203691
public function setMax($max)
    {
        if (null === $max) {
            $this->_max = null;
        } else if ($max < $this->_min) {
            /**
             * @see Zend_Validate_Exception
             */
            include_once 'Zend/Validate/Exception.php';
            throw new Zend_Validate_Exception(
                "The maximum must be greater than or equal to the minimum length, but "
                . "$max < $this->_min"
            );
        } else {
            $this->_max = (integer) $max;
        }

        return $this;
    }
163393
public function setMax(?string $max) : self
    {
        if ($max !== null) {
            $max = Decimal::parse($max);
        }

        $this->max = $max;

        return $this;
    }
322373
private function setMaxSteps($max)
    {
        $this->max = max(0, (int) $max);
        $this->stepWidth = $this->max ? Helper::strlen($this->max) : 4;
    }
767608
public function max($max, bool $isInclusive = true) : self
    {
        $this->createRule(MaxRule::class, [$max, $isInclusive]);

        return $this;
    }
1020255
public function allowMaxConditions($max)
    {
        if ($this->_maxConditions) {
            throw new BadMethodCallException('You can only set the maximum conditions only once.');
        }
        $this->_maxConditions = $max;
        $this->_allowNesting = false;
        $this->checkRestrictions();
        return $this;
    }
24215
public function setNormalMaximum($normalMaximum)
    {
        if ((is_bool($normalMaximum) && $normalMaximum === false) || is_float($normalMaximum) || is_double($normalMaximum)) {
            $this->normalMaximum = $normalMaximum;
        } else {
            $msg = "The normalMaximum argument must be a floating point value or false, '" . gettype($normalMaximum) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
1297700
public function setMinimum($minimum)
    {
        if (!\in_array($this->type, [self::TYPE_INTEGER, self::TYPE_NUMBER], true)) {
            throw new \Exception('minimum can only be set on type "integer" or "number');
        }

        $this->minimum = (int) $minimum;
    }
905483
public function setMax($value)
    {
        $this->max = $value === null ? null : (int) $value;

        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;
    }
249508
private function setMaxSteps($max) {
        $this->max = max(0, (int)$max);
        $this->stepWidth = $this->max ? Console::strlen($this->max) : 4;
    }