CronExpressionTimezoneConverter
class CronExpressionTimezoneConverter (View source)
Methods
Convert an event cron expression to the display timezone.
Resolve the timezone used by the given event.
Get offset components between the event and display timezones.
Convert the expression segments by the given offsets.
Build expressions for the given hour carry direction.
Shift the day-of-month field by the given carry, respecting month lengths.
Get the number of days in the given month of a non-leap year.
Shift a cron field by the given offset and group it by carry direction.
Expand a cron field into the sorted list of values it matches.
Shift values in a cron field and group them by carry direction.
Shift values within a cron field, wrapping around its domain.
Merge grouped values into a single sorted group.
Collapse a sorted list of values into the most compact cron field syntax.
Collapse consecutive runs of three or more values into ranges.
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.
static protected DateTimeZone
resolveEventTimezone(Event $event, DateTimeZone $defaultTimezone)
Resolve the timezone used by the given event.
static protected array{int, int, int}|null
offsetComponents(Event $event, DateTimeZone $eventTimezone, DateTimeZone $displayTimezone)
Get offset components between the event and display timezones.
static protected array<int, string>|null
convert(array $segments, int $hourOffset, int $minuteOffset)
Convert the expression segments by the given offsets.
static protected array<int, string>|null
expressionsForHourCarry(array $segments, array $parts, int $hourCarry)
Build expressions for the given hour carry direction.
static protected array<int, array{string, string}>|null
shiftDaysOfMonth(string $domField, string $monthField, int $carry)
Shift the day-of-month field by the given carry, respecting month lengths.
static protected int
daysInMonth(int $month)
Get the number of days in the given month of a non-leap year.
static protected array<int, string>|null
shiftedGroups(string $field, int $offset, int $min, int $max, bool $mergeCarries)
Shift a cron field by the given offset and group it by carry direction.
static protected array<int, int>|null
expand(string $field, int $min, int $max)
Expand a cron field into the sorted list of values it matches.
static protected array<int, array<int, int>>
shiftAndGroupValues(array $values, int $offset, int $mod, int $min = 0)
Shift values in a cron field and group them by carry direction.
static protected array<int, int>
shiftWrapped(array $values, int $offset, int $mod, int $min = 0)
Shift values within a cron field, wrapping around its domain.
static protected array<int, int>
mergeGroups(array $groups)
Merge grouped values into a single sorted group.
static protected string
collapse(array $values, int $min, int $max)
Collapse a sorted list of values into the most compact cron field syntax.
static protected string
collapseRuns(array $values)
Collapse consecutive runs of three or more values into ranges.