Flow PHP

ReferenceResolver

Read onlyYes
FinalYes

Methods

assertResolved()  : void
The gate. Refuses to hand an unresolved tree to execution.
resolve()  : T)
A new tree whose every reachable UnresolvedReference is replaced by a ResolvedReference carrying its Type and nullability. Never mutates $function.

Methods

resolve()

A new tree whose every reachable UnresolvedReference is replaced by a ResolvedReference carrying its Type and nullability. Never mutates $function.

public resolve(T $function, Schema $schema) : T)

Total: a reference the schema does not know is left unresolved, not thrown on.

One pass, not a fixpoint - this resolver inserts nothing, so a post-order pass over a finite tree converges in one traversal by construction. The day a coercion pass inserts Cast nodes into this tree, the pass count must be re-decided.

Sound: the only non-leaf return is $function->withChildren(), typed static; a root that is itself a reference leaf resolves to its Reference sibling class, never to a foreign node.

Parameters
$function : T
$schema : Schema
Tags
template
Return values
T)
On this page

Search results