PHP Класс CronLingo\Parser

Class Parser
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$cron Cron
$dayOfWeekMap array
$fieldMap array
$intervalMap array
$monthMap array
$position integer
$timeOfDayMap array
$tokenMap array Regular expressions used to tokenize a string
$tokens array Array of lexed tokens
$weekdayWeekendMap array

Открытые методы

Метод Описание
expects ( $token, $types ) Enforce expectations of a certain token
parse ( $value ) : string Parse a string into a CRON expression
reset ( ) Reset parser token position and CRON expression

Защищенные методы

Метод Описание
compileRegex ( ) : string Concatenate regex expressions into a single regex for performance
current ( ) : array Retrieve current token based on position
evaluate ( ) Evaluate tokens and build CRON expression
is ( $token, $types ) : boolean Check if a token is of a type
lex ( $string ) : array Lex a string into tokens
next ( integer $skip = 1 ) : boolean Look ahead in the token array
nilTime ( $field ) For simple expressions, zero out the time so the cron matches user expectation and does not execute constantly.
previous ( integer $skip = 1 ) : boolean Look behind in the token array
seek ( $index ) : boolean Seek a specific token

Описание методов

compileRegex() защищенный Метод

Concatenate regex expressions into a single regex for performance
protected compileRegex ( ) : string
Результат string

current() защищенный Метод

Retrieve current token based on position
protected current ( ) : array
Результат array

evaluate() защищенный Метод

Evaluate tokens and build CRON expression
protected evaluate ( )

expects() публичный Метод

Enforce expectations of a certain token
public expects ( $token, $types )
$token
$types

is() защищенный Метод

Check if a token is of a type
protected is ( $token, $types ) : boolean
$token
$types
Результат boolean

lex() защищенный Метод

Lex a string into tokens
protected lex ( $string ) : array
$string
Результат array

next() защищенный Метод

Look ahead in the token array
protected next ( integer $skip = 1 ) : boolean
$skip integer
Результат boolean

nilTime() защищенный Метод

E.g., someone would not expect "Every day on Tuesday" to run for every minute and hour on Tuesday.
protected nilTime ( $field )
$field

parse() публичный Метод

Parse a string into a CRON expression
public parse ( $value ) : string
$value
Результат string

previous() защищенный Метод

Look behind in the token array
protected previous ( integer $skip = 1 ) : boolean
$skip integer
Результат boolean

reset() публичный Метод

Reset parser token position and CRON expression
public reset ( )

seek() защищенный Метод

Seek a specific token
protected seek ( $index ) : boolean
$index
Результат boolean

Описание свойств

$cron защищенное свойство

protected Cron,cronlingo $cron
Результат Cron

$dayOfWeekMap защищенное свойство

protected array $dayOfWeekMap
Результат array

$fieldMap защищенное свойство

protected array $fieldMap
Результат array

$intervalMap защищенное свойство

protected array $intervalMap
Результат array

$monthMap защищенное свойство

protected array $monthMap
Результат array

$position защищенное свойство

protected int $position
Результат integer

$timeOfDayMap защищенное свойство

protected array $timeOfDayMap
Результат array

$tokenMap защищенное свойство

Regular expressions used to tokenize a string
protected array $tokenMap
Результат array

$tokens защищенное свойство

Array of lexed tokens
protected array $tokens
Результат array

$weekdayWeekendMap защищенное свойство

protected array $weekdayWeekendMap
Результат array