Adds a pattern component quantifier/length boundary

@param int|null $min
@param int|null $max

@return Flux
186025
public function length($min = null, $max = null)
	{
		$lastSegmentKey = $this->getLastSegmentKey();

		if (!is_null($min) && !is_null($max) && $max > $min)
		{
			$lengthPattern = sprintf('{%d,%d}', (int) $min, (int) $max);
		}
		elseif (!is_null($min) && !$max)
		{
			$lengthPattern = sprintf('{%d}', (int) $min);
		}
		else
		{
			$lengthPattern = '{1}';
		}

		return $this->replaceQuantifierByKey($lastSegmentKey, $lengthPattern);
	}
167369
public function range($min, $max, $addFilter = true, $forceInt = false)
    {
        if ($addFilter) {
            $this->addFilter(new RangeFilter($min, $max, $forceInt));
        }

        $this->min($min, false)
            ->max($max, false);

        return $this;
    }
447187
protected static function stringLengthMax(int $max, RuleInterface $next = null): RuleInterface
    {
        return $next === null ?
            new StringLengthMax($max) :
            new AndOperator(static::stringLengthMax($max), $next);
    }
656988
private static function calculateMean($min, $max)
    {
        if ($min === null || $max === null) {
            return null;
        }

        return ($min + $max) / 2;
    }
366872
public function range($min, $max, $message = null)
    {
        $this->set([
            'min' => (int)$min,
            'max' => (int)$max,
        ], $message);
        return $this;
    }
616110
protected static function stringLengthMin(int $min, RuleInterface $next = null): RuleInterface
    {
        return $next === null ?
            new StringLengthMin($min) :
            new AndOperator(static::stringLengthMin($min), $next);
    }
1004830
public function whereBetween($expr, $min, $max)
    {
        if ($min === null || $min === '') {
            return $max === null || $max === '' ? $this : $this->whereCmp($expr, '<=', $max);
        } elseif ($max === null || $max === '') {
            return $min === null || $min === '' ? $this : $this->whereCmp($expr, '>=', $min);
        }

        if (strpos($expr, '[') === false && strpos($expr, '(') === false) {

            if (strpos($expr, '.') !== false) {
                $id = strtr($expr, '.', '_');
                $expr = '[' . str_replace('.', '].[', $expr) . ']';

            } else {
                $id = $expr;
                $expr = '[' . $expr . ']';
            }

            $minKey = $id . '_min';
            $maxKey = $id . '_max';
        } else {
            $minKey = '_min_' . $this->_hiddenParamNumber;
            $maxKey = '_max_' . $this->_hiddenParamNumber;
            $this->_hiddenParamNumber++;
        }

        $this->_conditions[] = "$expr BETWEEN :$minKey AND :$maxKey";

        $this->_bind[$minKey] = $min;
        $this->_bind[$maxKey] = $max;

        return $this;
    }
842608
public function whereBetween($attribute, $min, $max)
    {
        switch (true) {
            case !is_empty_string($min) && !is_empty_string($max):
                return $this->parseWhere($attribute, 'between', [$min, $max]);

            case !is_empty_string($min):
                return $this->whereGte($attribute, $min);

            case !is_empty_string($max):
                return $this->whereLte($attribute, $min);

            default:
                return $this;
        }
    }
823906
public static function grid(float $min, float $max, int $n = 10) : array
    {
        if ($min > $max) {
            throw new InvalidArgumentException('Max cannot be less'
                . ' then min.');
        }

        if ($n < 2) {
            throw new InvalidArgumentException('Cannot generate less'
                . ' than 2 parameters.');
        }

        $interval = ($max - $min) / ($n - 1);

        return range($min, $max, $interval);
    }
891320
public function orWhereNotBetween(string $column, int $min, int $max)
    {
        $this->wConditions()->orNotBetween(...func_get_args());

        return $this;
    }
713140
protected function applyMinMaxStrings($minimum, $maximum)
    {
        if ($minimum && $maximum) {
            $errorString = t('A password must be between %s and %s characters long.', $minimum->getMinimumLength(), $maximum->getMaximumLength());
            $requirement = t('Must be between %s and %s characters long.', $minimum->getMinimumLength(), $maximum->getMaximumLength());
        } elseif ($minimum) {
            $errorString = t('Must be at least %s characters long.', $minimum->getMinimumLength());
            $requirement = t('A password must be at least %s characters long.', $minimum->getMinimumLength());
        } elseif ($maximum) {
            $errorString = t('A password must be at most %s characters long.', $maximum->getMaximumLength());
            $requirement = t('Must be at most %s characters long.', $maximum->getMaximumLength());
        } else {
            $errorString = t('Invalid Password.');
            $requirement = '';
        }

        $errorHandler = function ($validator, $code, $password) use ($errorString) { return $errorString; };
        $requirementHandler = function ($validator, $code) use (&$requirement) { return $requirement; };
        $minimum->setRequirementString($minimum::E_TOO_SHORT, $requirementHandler);
        $minimum->setErrorString($minimum::E_TOO_SHORT, $errorHandler);

        $maximum->setRequirementString($maximum::E_TOO_LONG, $requirementHandler);
        $maximum->setErrorString($maximum::E_TOO_LONG, $errorHandler);
    }
1284050
public function vBetween(Int $min = 0, Int $max = 0)
    {
        return $this->setJavascriptValidation
        (
            'ZNValidationBetween', 
            ['betweenBoth' => [':p1' => $min, ':p2' => $max]],
            ['betweenBoth' => [$min, $max]],
            [$min, $max]  
        );
    }
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;
    }
560090
public function setMin($min)
    {
        if (null !== $this->_max && $min > $this->_max) {
            /**
             * @see Zend_Validate_Exception
             */
            include_once 'Zend/Validate/Exception.php';
            throw new Zend_Validate_Exception(
                "The minimum must be less than or equal to the maximum length, but $min >"
                . " $this->_max"
            );
        }
        $this->_min = max(0, (integer) $min);
        return $this;
    }
805214
public function between($min, $max) {
        $this->check_role = 'between';
        $this->p1 = $min;
        $this->p2 = $max;
        $result = $this->value >= $min && $this->value <= $max;
        $this->checkResult($result);
        return $this;
    }
331905
function assetFileSize($min = null, $max = null) {
        $range = [];
        if ($min) $range['min'] = $min;
        if ($max) $range['max'] = $max;
        if (count($range)) $this->data['assetFileSize'] = $range;
        return $this;
    }
784043
public static function range($value, $min, $max): int
    {
        $value = Filter::int($value);
        $min = Filter::int($min);
        $max = Filter::int($max);

        return Vars::limit($value, $min, $max);
    }