PHP Class Cron\Schedule\CrontabSchedule

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

Méthodes publiques

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

Méthodes protégées

Méthode 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 méthode

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

checkDay() protected méthode

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

checkDayOfWeek() protected méthode

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

checkHour() protected méthode

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

checkMinute() protected méthode

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

checkMonth() protected méthode

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

checkPart() protected méthode

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

getPattern() public méthode

public getPattern ( ) : string
Résultat string

parsePattern() protected méthode

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

parseRule() protected méthode

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
Résultat array

setPattern() public méthode

public setPattern ( string $pattern )
$pattern string

valid() public méthode

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