Ensures $value is always within $min and $max range.

If lower, $min is returned. If higher, $max is returned.

@param int|float     $value
@param int|float     $min
@param int|float     $max

@return int|float
960950
protected function keep_within($value, $min, $max) {
        if ($value < $min) {
            return $min;
        }
        if ($value > $max) {
            return $max;
        }
        return $value;
    }
511510
public static function isRequiredIntegerRange($value, $min, $max)
    {
        return is_int($value) && $min <= $value && $max >= $value;
    }
932766
function Check($value)
    {
        if (!ctype_digit(Str::TrimLeft($value, '-')))
            $this->error = self::HasNonDigits;
        else
        {
            $floatValue = (float)$value;
            if ($floatValue < $this->min)
            {
                 $this->error = self::ExceedsMin;
            }
            else if ($floatValue > $this->max)
                $this->error = self::ExceedsMax;
        }
        return $this->error == '';
    }
135121
def minValue(self, value):
        """"""
        if isinstance(value, [int, float, long]):
            self._rangeMin = value
981716
public static function limit($number, $min, $max): int
    {
        return self::max(self::min($number, $min), $max);
    }
909177
public static function isOptionalNumericRange($value, $min, $max)
    {
        /* No additional validations when the value is null. */
        if (null === $value) {

            return true;
        }

        return self::isRequiredNumericRange($value, $min, $max);
    }
34662
public function range($value, int $min, int $max): bool
    {
        return is_string($value)
            && (mb_strlen($trimmed = trim($value)) >= $min)
            && (mb_strlen($trimmed) <= $max);
    }
1001440
public static function length($value, $min = null, $max = null)
    {
        $length = mb_strlen($value);

        if (is_numeric($min) && $min > 0 && $length < $min) {
            return false;
        }

        if (is_numeric($max) && $max > 0 && $length > $max) {
            return false;
        }

        return true;
    }
348958
protected function _validator_min($input, $value, $min) {
		if (!is_string($value) && !is_integer($value) && !is_float($value)) return false;
		if (is_string($value)) $value = (int)$value;
		return $value >= $min;
	}
1342742
public static function isBetween($value, $min, $max, $inclusive = false)
    {
        \settype($value, 'int');
        \settype($min, 'int');
        \settype($max, 'int');

        if ($min > $max) {
            throw new \InvalidArgumentException(\sprintf('%s cannot be less than %s for validation', $min, $max));
        }

        if (false === $inclusive) {
            return (($value > $min) && ($value < $max));
        }

        return (($value >= $min) && ($value <= $max));
    }
94928
public function min($value)
    {
        $v = $this->type('numeric')->value();

        if ($v === null) {
            return $this;
        }

        if ($v < $value) {
            throw new \Hail\Image\Exception\InvalidArgumentException(
                sprintf('Argument %d must be at least %s.', $this->key, $value)
            );
        }

        return $this;
    }
852738
public static function min($value, $min = 0, $equal = true)
    {
        return $equal ? $value >= $min : $value > $min;
    }
314923
public static function allInRangeOrAll($value, $minValue, $maxValue)
    {
        if (is_array($value)) {
            static::allRange($value, $minValue, $maxValue);

            return;
        }

        static::eq($value, 'all');
    }
368196
public static function isOptionalFloatRange($value, $min, $max)
    {
        /* No additional validations when the value is null. */
        if (null === $value) {

            return true;
        }

        return self::isRequiredFloatRange($value, $min, $max);
    }
244288
public function setMin($value)
    {
        $this->min = $value === null ? null : (int) $value;

        return $this;
    }
1035569
public function rule_min( $key, $value, $min )
	{
		return $this->rule_min_num( $key, strlen( $value ), $min );
	}
297970
public function minMax($min, $max=PHP_INT_MAX){
        return $this->markErrorIf($this->value < $min || $this->value > $max);
    }