Flow PHP

Parameter

Read onlyYes
FinalYes

Every as*() arm separates the two axes: a genuine NULL flowing through is not an error and propagates (or takes the arm's null-input default), while a non-null value that cannot coerce throws - optional() is the door for pipelines that want the old silent tolerance.

Methods

__construct()  : mixed
as()  : null|T
asArray()  : null|array<string|int, mixed>
asBoolean()  : bool|null
asEnum()  : null|T
asFloat()  : float|null
asInstanceOf()  : null|T
asInt()  : ($default is null ? int|null : int)
$default applies to a NULL input only - a malformed value always throws.
asListOfObjects()  : null|array<string|int, object>
asNumber()  : ($default is null ? int|float|null : int|float)
$default applies to a NULL input only - a malformed value always throws.
asObject()  : object|null
asString()  : ($default is null ? string|null : string)
$default applies to a NULL input only - a malformed value always throws.
asValue()  : null|array<string|int, mixed>|bool|float|int|object|string
eval()  : null|array<string|int, mixed>|bool|float|int|object|string

Methods

__construct()

public __construct(mixed $function) : mixed
Parameters
$function : mixed

as()

public as(Row $row, FlowContext $context, Type<string|int, T...$types) : null|T
Parameters
$row : Row
$context : FlowContext
$types : Type<string|int, T>
Tags
template
Return values
null|T

asInt()

$default applies to a NULL input only - a malformed value always throws.

public asInt(Row $row, FlowContext $context[, int|null $default = null ]) : ($default is null ? int|null : int)
Parameters
$row : Row
$context : FlowContext
$default : int|null = null
Return values
($default is null ? int|null : int)

asListOfObjects()

public asListOfObjects(Row $row, FlowContext $context, class-string $class) : null|array<string|int, object>
Parameters
$row : Row
$context : FlowContext
$class : class-string
Return values
null|array<string|int, object>

asNumber()

$default applies to a NULL input only - a malformed value always throws.

public asNumber(Row $row, FlowContext $context[, int|float|null $default = null ]) : ($default is null ? int|float|null : int|float)
Parameters
$row : Row
$context : FlowContext
$default : int|float|null = null
Return values
($default is null ? int|float|null : int|float)

asString()

$default applies to a NULL input only - a malformed value always throws.

public asString(Row $row, FlowContext $context[, string|null $default = null ]) : ($default is null ? string|null : string)
Parameters
$row : Row
$context : FlowContext
$default : string|null = null
Return values
($default is null ? string|null : string)

asValue()

public asValue(Row $row) : null|array<string|int, mixed>|bool|float|int|object|string
Parameters
$row : Row
Return values
null|array<string|int, mixed>|bool|float|int|object|string

eval()

public eval(Row $row, FlowContext $context) : null|array<string|int, mixed>|bool|float|int|object|string
Parameters
$row : Row
$context : FlowContext
Return values
null|array<string|int, mixed>|bool|float|int|object|string
On this page

Search results