@param string    $partName
@param int       $min
@param int       $max
@param array     $formats
@param \DateTime $now

@return bool|null
556954
protected function checkPart($partName, $min, $max, array $formats, \DateTime $now)
    {
        if ($this->parts[$partName] != '*') {
            foreach ($this->parseRule($this->parts[$partName], $min, $max) as $value) {
                foreach ($formats as $format) {
                    if ($now->format($format) == $value) {
                        return true;
                    }
                }
            }

            return false;
        }

        return true;
    }
656988
private static function calculateMean($min, $max)
    {
        if ($min === null || $max === null) {
            return null;
        }

        return ($min + $max) / 2;
    }
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));
    }
764160
public function getDateTime()
    {
        if (!empty($this->parts) && $this->parts[0] instanceof DatePart) {
            return $this->parts[0]->getDateTime();
        }
        return null;
    }
1327248
public function stmt_fragment($part, $args=[]) {
		$type = $this->dbtype;
		if ($part == 'engine') {
			if ($type == 'mysql')
				# we only intent to support FOREIGN KEY-capable engines
				return "ENGINE=InnoDB";
			return '';
		}
		if ($part == "index") {
			if ($type == 'pgsql')
				return 'SERIAL PRIMARY KEY';
			if ($type == 'mysql')
				return 'INTEGER PRIMARY KEY AUTO_INCREMENT';
			return 'INTEGER PRIMARY KEY AUTOINCREMENT';
		}
		if ($part == 'datetime') {
			$delta = 0;
			if ($args && isset($args['delta']))
				$delta = (int)$args['delta'];
			return $this->stmt_fragment_datetime($delta);
		}
		return "";
	}
158069
public function parse(MimePart $part)
    {
        if (!$this->middleware) {
            return $part;
        }
        $part = call_user_func(array($this->middleware, 'parse'), $part, $this->next);
        return $part;
    }
1182915
public function getPartData($part = null)
    {
        if ($part === null) {
            $part = $this->resource;
        }

        return mailparse_msg_get_part_data($part);
    }
564153
public function getPart($num)
    {
        --$num;
        if (!isset($this->_partPos[$num])) {
            /**
             * @see Zend_Mail_Exception
             */
            // require_once 'Zend/Mail/Exception.php';
            throw new Zend_Mail_Exception('part not found');
        }

        return new self(array('file' => $this->_fh, 'startPos' => $this->_partPos[$num][0],
                              'endPos' => $this->_partPos[$num][1]));
    }
207153
public function vLimit(Int $min = 0, Int $max = NULL)
    {
        $key['minchar'] = [':p1' => $min];
        $typ['minchar'] = $min;

        if( $max !== NULL )
        {
            $key['maxchar'] = [':p1' => $max];
            $typ['maxchar'] = $max;
        }

        return $this->onInvalidEventPattern('.{' . $min . ',' . $max . '}', $key, [], $typ);
    }
417520
static function Parse($format, $dateTimeString)
     {
         $dt = \DateTime::createFromFormat($format, $dateTimeString);
         if (!$dt)
             return null;
         
         return self::FromDateTime($dt);
     }
1190125
public static function isLengthBetween($value, $min, $max)
    {
        if (is_array($min)) {
            $max = $min[1];
            $min = $min[0];
        }

        if (self::isLengthGte($value, $min) && self::isLengthLte($value, $max)) {
            return true;
        }

        return false;
    }
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);
	}
597482
public static function datetime($time = null, $nowIfNull = true, $format = 'Y-m-d H:i:s')
    {
        if (empty($time)) {
            return $nowIfNull ? date($format) : null;
        } else {
            return date($format, $time);
        }
    }
242615
public function increment($part)
    {
        foreach (array_reverse(self::$ordinality) as $currentPart) {
            if ($currentPart === $part) {
                switch ($part) {
                    case self::STABILITY:
                        $this->set(
                            $currentPart, 
                            self::$stabilities[
                                array_search(
                                    $this->get($currentPart), 
                                    self::$stabilities
                                ) +1
                            ]
                        );
                        break;
                    default:
                        $this->set($currentPart, $this->get($currentPart) +1);
                        break;
                }
                break;
            } else {
                switch ($currentPart) {
                    case self::STABILITY_NO:
                        $this->set($currentPart, null);
                        break;
                    case self::STABILITY:
                        $this->set($currentPart, 'dev');
                        break;
                    default:
                        $this->set($currentPart, '0');
                }
            }
        }

        return $this;
    }
466219
public function whereBetween($attribute, $min, $max)
    {
        return $this->addFilter(function (Store $store) use ($attribute, $min, $max) {
            $current = $store->get($attribute);
            if ($current instanceof \DateTime) {
                return (new Carbon($current))->between(new Carbon($min), new Carbon($max));
            }

            return $current >= $min && $current <= $max;
        });
    }
641933
private function getMaxMtime($parts, $getInfoBy)
  {
    $mtime = [];
    if (is_array($parts))
    {
      foreach ($parts as $part)
      {
        switch ($getInfoBy)
        {
          case 'full_path_name_with_hash':
            $info = $this->getResourceInfoByHash($part);
            break;

          case 'full_path_name':
            $info = $this->getResourceInfo($part);
            break;

          default:
            throw new FallenException('$theGetInfoBy', $getInfoBy);
        }
        $mtime[] = $info['mtime'];
      }
    }
    else
    {
      $mtime[] = filemtime($parts);
    }

    return max($mtime);
  }
999594
private function processQueryPart($part)
    {
        $queryPart = (string) $part;

        if (is_object($part) && $part instanceof self && $part->count() > 1) {
            return $this->preSeparator . $queryPart . $this->postSeparator;
        }

        // Fixes DDC-1237: User may have added a where item containing nested expression (with "OR" or "AND")
        if (stripos($queryPart, ' OR ') !== false || stripos($queryPart, ' AND ') !== false) {
            return $this->preSeparator . $queryPart . $this->postSeparator;
        }

        return $queryPart;
    }