get a single cron style notation and parse it into numeric value

@param string $s cron string element
@param int $min minimum possible value
@param int $max maximum possible value
@return int parsed number
347231
protected static function _parseCronNumbers($s, $min, $max)
    {
        $result = array();
        $v = explode(',', $s);
        foreach ($v as $vv) {
            $vvv = explode('/', $vv);
            $step = empty($vvv[1]) ? 1 : $vvv[1];
            $vvvv = explode('-', $vvv[0]);
            $_min = count($vvvv) == 2 ? $vvvv[0] : ($vvv[0] == '*' ? $min : $vvv[0]);
            $_max = count($vvvv) == 2 ? $vvvv[1] : ($vvv[0] == '*' ? $max : $vvv[0]);
            for ($i = $_min; $i <= $_max; $i += $step) {
                $result[$i] = intval($i);
            }
        }
        ksort($result);

        return $result;
    }
905696
public function setMin(string $min) : Datetime
    {
        $min = date($this->format, strtotime($min));
        $this->attributes['min'] = $min;
        return $this->addTest('min', function ($value) use ($min) {
            return $value >= $min;
        });
    }
1066318
public function getInteger($min, $max)
    {
        $min = (int) $min;
        $max = (int) $max;

        if ($this->isOutOfBounds($min, 0, $max)) {
            throw new \InvalidArgumentException('Invalid minimum or maximum value');
        }

        return $this->generator->getNumber($min, $max);
    }
577005
public static function to_range($value, $min=null, $max=null) {
		ref\sanitize::to_range($value, $min, $max);
		return $value;
	}
281667
public static function length($val, $min, $max = null)
    {
        return isset($val[$min - 1]) && (null === $max || !isset($val[$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);
    }
219931
public function removeByScore($min, $max){
        return $this->getConnection()->getClient()->zRemRangeByScore($this->name, $min, $max);
    }
1016598
public function matchQuantity($min, $max = null)
	{
		$match = '{'.$min;

		if ($max !== null)
		{
			$match .= ',' . $max;
		}

		$match .= '}';

		$this->value($match);

		return $this;
	}
422053
protected static function check($value, $min, $max)
    {
        $length = strlen($value);

        if ($length < $min)
            return self::STATUS_WARNING;

        if ($min <= $length && $length <= $max)
            return self::STATUS_GOOD;

        return self::STATUS_DANGER;
    }
209097
public static function ruleLenRange($min, $max)
    {
        return function ($input) use ($min, $max) {
            return strlen($input) >= $min && strlen($input) <= $max;
        };
    }
656988
private static function calculateMean($min, $max)
    {
        if ($min === null || $max === null) {
            return null;
        }

        return ($min + $max) / 2;
    }
1164908
public static function numberLimit($val, $min, $max)
    {
        return ($val > $min ? ($val < $max ? $val : $max) : $min);
    }
799097
function betweenDates($min, $max, $msg)
    {
        $this->minDate($min, $msg);
        $this->maxDate($max, $msg);
    }
436103
protected function rand($min, $max)
    {
        $this->seed = md5($this->seed);
        $rand = hexdec(substr($this->seed, 0, 8));
        return ($rand % ($max - $min + 1)) + $min;
    }
382835
public static function formatToDate($cronStr, $maxSize = 1)
    {
        if (!static::check($cronStr)) {
            throw new \Exception("wrong format: $cronStr", 1);
        }
        self::$tags = preg_split('#\s+#', $cronStr);
        $crons = [
            'minutes' => static::parseTag(self::$tags[0], 0, 59), //分钟
            'hours' => static::parseTag(self::$tags[1], 0, 23), //小时
            'day' => static::parseTag(self::$tags[2], 1, 31), //一个月中的第几天
            'month' => static::parseTag(self::$tags[3], 1, 12), //月份
            'week' => static::parseTag(self::$tags[4], 0, 6), // 星期
        ];
        $crons['week'] = array_map(function ($item) {
            return static::$weekMap[$item];
        }, $crons['week']);
        return self::getDateList($crons, $maxSize);
    }
1138650
public static function text($chars, $min, $max)
    {
        $length = mt_rand($min, $max);
        $charLength = mb_strlen($chars);
        $result = '';
        for($i = 0; $i < $length; ++$i)
        {
            $result .= mb_substr($chars, mt_rand(1, $charLength) - 1, 1);
        }
        return $result;
    }
363183
public function getRandomNumber($min = -1, $max = -1) {
		if ($this->nextRandomNumber >= 0 && $this->nextRandomNumber >= ($min == -1 ? 0 : $min) && $this->nextRandomNumber <= ($max == -1 ? $this->getMaxRandomNumber() : $max)) {
			$rand = $this->nextRandomNumber;
			$this->nextRandomNumber = -1;

			return $rand;
		}

		return $this->realRandom->getRandomNumber($min, $max);
	}