Skip to content
docsv0.3.0

TuiNodeRendererRegistry

Resolves which renderer paints a node, by asking each registered renderer whether it supports it. First match wins, so a catch-all renderer must be registered last.

TuiNodeRendererRegistry::register()

public function register(Milpa\Live\Contracts\Tui\TuiNodeRendererInterface $renderer): void

Adds a renderer to the resolution order. First registered is first asked, so a catch-all renderer must go last.

Parameters

Parameters of register()
NameTypeDescription
$rendererMilpa\Live\Contracts\Tui\TuiNodeRendererInterface

TuiNodeRendererRegistry::resolve()

public function resolve(Milpa\Live\ValueObjects\Tui\TuiNode $node): ?Milpa\Live\Contracts\Tui\TuiNodeRendererInterface

The first registered renderer that supports this node, or null when none does — an unknown type resolves to nothing rather than being guessed at.

Parameters

Parameters of resolve()
NameTypeDescription
$nodeMilpa\Live\ValueObjects\Tui\TuiNode