Flow PHP

PromotingUnifier implements TypeUnifier

Read onlyYes
FinalYes

Interfaces

TypeUnifier

Methods

__construct()  : mixed
unify()  : null|Type<string|int, mixed>
Pairwise. Called by ContainerUnification at depth >= 1, where nullability composes by OR.
unifyAll()  : null|Type<string|int, mixed>
N-ary, and the root entry point every caller uses. Strips every root's nullability, folds the bases under this policy, then re-wraps by $rule read from the original operands.

Methods

unify()

Pairwise. Called by ContainerUnification at depth >= 1, where nullability composes by OR.

public unify(Type $left, Type $right) : null|Type<string|int, mixed>

Not the root entry point.

Parameters
$left : Type
$right : Type
Return values
null|Type<string|int, mixed>

null = "no common type under this policy" - a value, not an exception

unifyAll()

N-ary, and the root entry point every caller uses. Strips every root's nullability, folds the bases under this policy, then re-wraps by $rule read from the original operands.

public unifyAll(NullabilityRule $rule, Type ...$types) : null|Type<string|int, mixed>

$rule is first because PHP requires the variadic last.

Parameters
$rule : NullabilityRule
$types : Type
Return values
null|Type<string|int, mixed>
On this page

Search results