@param string|null $max The maximum value, or null to remove it.

@return NumberValidator

@throws \InvalidArgumentException If not a valid number.
163393
public function setMax(?string $max) : self
    {
        if ($max !== null) {
            $max = Decimal::parse($max);
        }

        $this->max = $max;

        return $this;
    }
1337320
public function validateMax($amount)
    {
        $this->validator_attributes[] = 'data-parsley-max="' . (float)$amount . '"';

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

        return $this;
    }
76993
public function setMax($max) : self
    {
        if (null === $max || (!is_float($max) && !is_int($max))) {
            throw new \InvalidArgumentException('max must be either a float or an integer.');
        }

        $this->max = $max;

        return $this;
    }
288105
public function setMaxComparison(ComparisonExpression $maxComparison)
    {
        if($maxComparison->getField() != $this->getField()) {
            throw new \InvalidArgumentException('Field of Minimum Comparison is not equal to field of Range.');
        } else if($maxComparison->getValue()->isNull() && !(ComparisonExpression::LT & $maxComparison->getOperator())) {
            throw new \InvalidArgumentException('Range.max has to be an Any or a Less Comparison.');
        }

        $this->maxComparison = $maxComparison;
        return $this;
    }
1335459
public function setMax($max)
  {
    if (!is_numeric($max))
    {
      $max = null;
    }
    $this->max = $max;

    return $this;
  }
200611
public function rule_max( $key, $value, $max )
	{
		return $this->rule_max_num( $key, strlen( $value ), $max );
	}
912384
private function isValidResult($number, $min, $max)
    {
        return is_int($number) && $number >= $min && $number <= $max;
    }
749967
public static function isOptionalNumberRange($value, $min, $max)
    {
        /* No additional validations when the value is null. */
        if (null === $value) {

            return true;
        }

        return self::isRequiredNumberRange($value, $min, $max);
    }
68614
public function setMax($max)
    {
        $max = (int) $max;

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

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

        $this->max  = $max;
    }
803505
public function max($max = null, $addFilter = true, $forceInt = false)
    {
        if ($addFilter) {
            $this->addFilter(new RangeFilter(null, $max, $forceInt));
        }

        return $this->attr('max', $max);
    }
263406
public function setMax($max)
    {
        
    	// Support .x notation.
    	if (!empty($max)){
        	$this->max = preg_replace('/x/u', '99999', $max);
    	}
    	else{
    		$this->max = null;
    	}
        
    }
668756
public function maxDepth($value = null)
    {
        if (func_num_args()) {
            $this->maxDepth = $value;
            return $this;
        }
        return $this->maxDepth;
    }
261332
public function visitMaximumConstraint(NumberValue\MaximumConstraint $constraint)
    {
        $value = $this->currentValue();
        if (
            !$value instanceof Value\NumberValueInterface ||
            $value->value() <= $constraint->maximum()
        ) {
            return $this->createResult();
        }

        return $this->createSingleIssueResult($constraint);
    }
1099048
public function setMatchMax($matchMax)
    {
        if (is_int($matchMax) === true && $matchMax >= 0) {
            $this->matchMax = $matchMax;
        } else {
            $msg = "The 'matchMax' argument must be a positive integer, '" . gettype($matchMax) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
1199306
function range($min = null, $max = null)
	{
		$this->min($min);
		$this->max($max);
		return $this;
	}
209097
public static function ruleLenRange($min, $max)
    {
        return function ($input) use ($min, $max) {
            return strlen($input) >= $min && strlen($input) <= $max;
        };
    }