断言一个数值在另外两个数值之间
@param int $value
@param int $min
@param int $max
@return boolean
508669
private function between($value, $min = null, $max = null) {

        $value = intval($value);

        if ($min !== null && $max !== null) {
            return $value >= intval($min) && $value <= intval($max);
        }

        if ($min !== null) {
            return intval($min) <= $value;
        }

        if ($max !== null) {
            return $value <= intval($max);
        }
        return false;
    }
577005
public static function to_range($value, $min=null, $max=null) {
		ref\sanitize::to_range($value, $min, $max);
		return $value;
	}
1669
public function isInteger($number, int $min = null, int $max = null): bool
    {
        return isset($min) || isset($max)
            ? filter_var($number, FILTER_VALIDATE_INT, $this->getIntegerOptionsBetween($min, $max))
            : filter_var($number, FILTER_VALIDATE_INT);
    }
970070
public static function between($min, $max): Compare
    {
        $value = $min > $max ? [$max, $min] : [$min, $max];
        return new Compare('bt', $value);
    }
495543
public static function isLt($value, $min)
    {
        is_array($min) && $min = $min[0];
        if (!is_numeric($value)) {
            return false;
        } elseif (function_exists('bccomp')) {
            return bccomp($min, $value, 14) == 1;
        } else {
            return $value < $min;
        }
    }
1251880
public static function random($min, $max = null)
    {
        if (String::isEmpty($max) ||
            $max > getrandmax()) {
            $max = getrandmax();
        }

        return rand($min, $max);
    }
73889
public static function getRandom($min,$max){
		if($min === null)
			$min = 0;
		if($max === null)
			$max = 1;
		return mt_rand($min, $max);
	}
145733
public static function isGte($value, $max)
    {
        is_array($max) && $max = $max[0];
        if (!is_numeric($value)) {
            return false;
        } else {
            return $value >= $max;
        }
    }
1356664
public function setMinMax($min,$max=null)
    {
       $this->min = $min; 
       $this->max = $max; 
    }
1325608
private function max($value, $max)
    {
        if (is_string($value)) {
            $value = strlen($value);
        }

        return $value <= $max;
    }
443248
public static function fieldNotInRange(string $field, int $value, int $min, int $max) : self
    {
        return new DateTimeException("Invalid $field: $value is not in the range $min to $max.");
    }
505103
public function countArray($min, $max = PHP_INT_MAX)
    {
        return $this->markErrorIf(!is_array($this->value)||count($this->value) < $min || count($this->value) > $max, false);
    }
805226
public function setIDRange($min, $max)
    {
        assert(is_numeric($min));
        assert(is_numeric($max));
        assert($min <= $max);
        $this->_min_id = $min;
        $this->_max_id = $max;

        return $this;
    }
188686
static protected function parseInteger($value, $offset, $minLength, $maxLength)
    {
        for ($len = $maxLength; $len >= $minLength; --$len) {
            $v = self::$_mbstringAvailable ? mb_substr($value, $offset, $len, APP_CHARSET) : substr($value, $offset, $len);
            if (ctype_digit($v) && (self::$_mbstringAvailable ? mb_strlen($v, APP_CHARSET) : strlen($v)) >= $minLength) {
                return $v;
            }
        }
        return false;
    }
852326
private function min($value, $min)
    {
        if (is_string($value)) {
            $value = strlen($value);
        }

        return $value >= $min;
    }
867297
public static function int($min, $max)
    {
        $int = self::php7Int($min, $max);
        if (! isset($int)) {
            $int = self::bytesToInt($min, $max);
        }
        return $int;
    }
1110664
public static function isRequiredNumberRange($value, $min, $max)
    {
        return (is_int($value) || is_float($value)) && $min <= $value && $max >= $value;
    }