整数验证

@param int $value
@param int|null $min
@param int|null $max
@return boolean
357086
public static function int($value, $min = null, $max = null)
    {
        // 最小值
        if(null !== $min && $value < $min)
        {
            return false;
        }
        // 最大值
        if(null !== $max && $value > $max)
        {
            return false;
        }
        // 整数验证
        return ((int)$value) == $value;
    }
43088
public function isValidStringLength($str, $min = null, $max = null): bool
    {
        $len = mb_strlen($str, 'UTF-8');

        return (($min !== null) && ($len >= $min)) || (($max !== null) && ($len <= $max));
    }
960950
protected function keep_within($value, $min, $max) {
        if ($value < $min) {
            return $min;
        }
        if ($value > $max) {
            return $max;
        }
        return $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;
        }
    }
475057
protected function shouldWriteOutput($min=0, $max=null)
    {
        $out = $this->getOutput();
        if (!$out instanceof OutputInterface) {
            return false;
        }
        $v = $out->getVerbosity();

        return !($v<$min || ($max!==null && $v>$max));
    }
867297
public static function int($min, $max)
    {
        $int = self::php7Int($min, $max);
        if (! isset($int)) {
            $int = self::bytesToInt($min, $max);
        }
        return $int;
    }
1253014
public function whereBetween($field, $min, $max)
    {
        if ($min === null || $min === '') {
            return $max === null || $max === '' ? $this : $this->whereCmp($field, '<=', $max);
        } elseif ($max === null || $max === '') {
            return $min === null || $min === '' ? $this : $this->whereCmp($field, '>=', $min);
        }

        $this->_filters[] = [$field => ['$gte' => $this->normalizeValue($field, $min), '$lte' => $this->normalizeValue($field, $max)]];

        return $this;
    }
817058
public function min_files($name, $value, $min){
        if(! $this->not_empty($name, $value)){
            return TRUE;
        }
        if(count($value['name']) >= $min){
            return TRUE;
        }else{
            $this->add_message($name, 'min_files', array('min' => $min));
            return FALSE;
        }
    }
114675
public static function RAND($min = 0, $max = 0) {
		$min		= PHPExcel_Calculation_Functions::flattenSingleValue($min);
		$max		= PHPExcel_Calculation_Functions::flattenSingleValue($max);

		if ($min == 0 && $max == 0) {
			return (rand(0,10000000)) / 10000000;
		} else {
			return rand($min, $max);
		}
	}
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);
    }
463410
public static function range($value, $min, $max)
    {
        return Validator::int()->between($min, $max)->validate($value);
    }
629874
public static function limitInteger($int, $min = null, $max = null)
    {
        $int = (int) $int;

        if ($min !== null && $int < $min) {
            $int = $min;
        }

        if ($max !== null && $int > $max) {
            $int = $max;
        }

        return (int) $int;
    }
1072381
private function quickSort($min, $max) {

        $i = $min;
        $j = $max;

        $pivot = $this->values[$min + ($max - $min) / 2];

        while ($i <= $j) {

            while (true === $this->functor->compare($this->values[$i], $pivot)) {
                ++$i;
            }

            while (true === $this->functor->compare($pivot, $this->values[$j])) {
                --$j;
            }

            if ($i <= $j) {
                $this->swap($i, $j);
                ++$i;
                --$j;
            }
        }

        if ($min < $j) {
            $this->quickSort($min, $j);
        }
        if ($i < $max) {
            $this->quickSort($i, $max);
        }
    }
297970
public function minMax($min, $max=PHP_INT_MAX){
        return $this->markErrorIf($this->value < $min || $this->value > $max);
    }
970070
public static function between($min, $max): Compare
    {
        $value = $min > $max ? [$max, $min] : [$min, $max];
        return new Compare('bt', $value);
    }
1373385
public static function isLengthGte($value, $max)
    {
        is_array($max) && $max = $max[0];
        return self::isLength($value, $max);
    }
1295288
function (value, min, max) {
        value = parseInt(value, 10);
        min = min | 0;
        if (isNaN(value) || value < min) {
            return false;
        }
        if (max && value > max) {
            return false;
        }
        return true;
    }