class CronExpressionTimezoneConverter (View source)

Methods

static string[]
forEvent(Event $event, DateTimeZone $timezone)

Convert an event cron expression to the display timezone.

static DateTimeZone
resolveEventTimezone(Event $event, DateTimeZone $defaultTimezone)

Resolve the timezone used by the given event.

static 
offsetComponents(DateTimeZone $eventTimezone, DateTimeZone $displayTimezone)

Get offset components between the event and display timezones.

static array<int,string>
expressionsForHourCarry(array $segments, array $parts, int $hourCarry)

Build expressions for the given hour carry direction.

static array<int,string>
shiftAndGroup(string $field, int $offset, int $mod, $min = 0)

Shift values in a cron field and group them by carry direction.

static string
shiftField(string $field, int $offset, int $mod, int $min = 0)

Shift a cron field by the given offset.

Details

static string[] forEvent(Event $event, DateTimeZone $timezone)

Convert an event cron expression to the display timezone.

Returns one or more expressions when values straddle a day boundary.

Parameters

Event $event
DateTimeZone $timezone

Return Value

string[]

static protected DateTimeZone resolveEventTimezone(Event $event, DateTimeZone $defaultTimezone)

Resolve the timezone used by the given event.

Parameters

Event $event
DateTimeZone $defaultTimezone

Return Value

DateTimeZone

static protected offsetComponents(DateTimeZone $eventTimezone, DateTimeZone $displayTimezone)

Get offset components between the event and display timezones.

Parameters

DateTimeZone $eventTimezone
DateTimeZone $displayTimezone

static protected array<int,string> expressionsForHourCarry(array $segments, array $parts, int $hourCarry)

Build expressions for the given hour carry direction.

Parameters

array $segments
array $parts
int $hourCarry

Return Value

array<int,string>

static protected array<int,string> shiftAndGroup(string $field, int $offset, int $mod, $min = 0)

Shift values in a cron field and group them by carry direction.

Parameters

string $field
int $offset
int $mod
$min

Return Value

array<int,string>

static protected string shiftField(string $field, int $offset, int $mod, int $min = 0)

Shift a cron field by the given offset.

Parameters

string $field
int $offset
int $mod
int $min

Return Value

string