PHP Class Cron\Schedule\CrontabSchedule

Author: Dries De Peuter ([email protected])
Inheritance: implements Cron\Schedule\ScheduleInterface
Exibir arquivo Open project: cron/cron

Public Methods

Method Description
__construct ( null $pattern = null )
getPattern ( ) : string
setPattern ( string $pattern )
valid ( DateTime $now ) : boolean Validate if this pattern can run on the given date.

Protected Methods

Method Description
checkDay ( DateTime $now ) : boolean | null Check if the day matches.
checkDayOfWeek ( DateTime $now ) : boolean | null Check if the day of the week matches.
checkHour ( DateTime $now ) : boolean | null Check if the hour matches.
checkMinute ( DateTime $now ) : boolean | null Check if the minute matches.
checkMonth ( DateTime $now ) : boolean | null Check if the month matches.
checkPart ( string $partName, integer $min, integer $max, array $formats, DateTime $now ) : boolean | null
parsePattern ( string $pattern ) : string[] Parse the pattern into a rule for every property.
parseRule ( string $rule, integer $min, integer $max ) : array Convert a rule to an array of all its values.

Method Details

__construct() public method

public __construct ( null $pattern = null )
$pattern null

checkDay() protected method

Check if the day matches.
protected checkDay ( DateTime $now ) : boolean | null
$now DateTime
return boolean | null

checkDayOfWeek() protected method

Check if the day of the week matches.
protected checkDayOfWeek ( DateTime $now ) : boolean | null
$now DateTime
return boolean | null

checkHour() protected method

Check if the hour matches.
protected checkHour ( DateTime $now ) : boolean | null
$now DateTime
return boolean | null

checkMinute() protected method

Check if the minute matches.
protected checkMinute ( DateTime $now ) : boolean | null
$now DateTime
return boolean | null

checkMonth() protected method

Check if the month matches.
protected checkMonth ( DateTime $now ) : boolean | null
$now DateTime
return boolean | null

checkPart() protected method

protected checkPart ( string $partName, integer $min, integer $max, array $formats, DateTime $now ) : boolean | null
$partName string
$min integer
$max integer
$formats array
$now DateTime
return boolean | null

getPattern() public method

public getPattern ( ) : string
return string

parsePattern() protected method

Parse the pattern into a rule for every property.
protected parsePattern ( string $pattern ) : string[]
$pattern string
return string[]

parseRule() protected method

Convert a rule to an array of all its values.
protected parseRule ( string $rule, integer $min, integer $max ) : array
$rule string
$min integer
$max integer
return array

setPattern() public method

public setPattern ( string $pattern )
$pattern string

valid() public method

Validate if this pattern can run on the given date.
public valid ( DateTime $now ) : boolean
$now DateTime
return boolean