SlotFlow API Documentation

TemporalContext
in package

FinalYes

The temporal configuration a slot space is expanded along: a time axis, the resolver that gives each movement edge a duration, and the calendar that may delay when an edge departs.

This is the whole of what the timed layer needs from a slot space, gathered into one value so a space carries a single temporal dependency rather than three, and so the raw-callable normalization lives in one place instead of once per consumer.

Instances are immutable; the with* methods return copies.

Table of Contents

Properties

$axis  : TimeAxis|null
$dispatchCalendar  : DispatchCalendarInterface|null
$durationResolver  : TimedDurationResolverInterface|null

Methods

__construct()  : mixed
Create one temporal context.
normalizeDispatchCalendar()  : DispatchCalendarInterface|null
Normalize a raw dispatch calendar into the interface, wrapping a callable if needed.
normalizeDurationResolver()  : TimedDurationResolverInterface|null
Normalize a raw duration resolver into the interface, wrapping a Closure if needed.
of()  : self
Build a context from raw inputs, normalizing callables into their interface wrappers.
withAxis()  : self
Return a copy carrying the given time axis.
withDispatchCalendar()  : self
Return a copy carrying the given dispatch calendar.
withDurationResolver()  : self
Return a copy carrying the given duration resolver.

Properties

Methods

normalizeDurationResolver()

Normalize a raw duration resolver into the interface, wrapping a Closure if needed.

public static normalizeDurationResolver(mixed $durationResolver) : TimedDurationResolverInterface|null

A wrapped Closure is validated at call time rather than declaration time, because a Closure carries no return type the wrapper could check up front.

Parameters
$durationResolver : mixed
Tags
throws
SlotFlowInvalidArgumentException

if the input is neither a Closure nor the interface

Return values
TimedDurationResolverInterface|null

of()

Build a context from raw inputs, normalizing callables into their interface wrappers.

public static of([TimeAxis|null $axis = null ][, TimedDurationResolverInterface|Closure|null $durationResolver = null ][, DispatchCalendarInterface|callable|null $dispatchCalendar = null ]) : self
Parameters
$axis : TimeAxis|null = null
$durationResolver : TimedDurationResolverInterface|Closure|null = null
$dispatchCalendar : DispatchCalendarInterface|callable|null = null
Tags
throws
SlotFlowInvalidArgumentException

if a resolver is neither a Closure nor the interface

Return values
self

withAxis()

Return a copy carrying the given time axis.

public withAxis(TimeAxis|null $axis) : self
Parameters
$axis : TimeAxis|null
Return values
self

withDurationResolver()

Return a copy carrying the given duration resolver.

public withDurationResolver(mixed $durationResolver) : self
Parameters
$durationResolver : mixed
Return values
self
On this page

Search results