Skip to content

ValidatorNode

Format-independent description of a single declaration: the resolved class, its parameters/arguments, the request methods it applies to, and any nested validators (and/or/not/xor children).

This is the intermediate representation shared by every front-end (currently only the XML parser) and every back-end (the runtime cache emitter, the fluent-source emitter). Its shape is a snapshot of what ValidatorConfigHandler used to compute and immediately discard while emitting PHP text directly from the DOM walk.

final class ValidatorNode

Since1.0.0
SourceValidator/Compiler/Ir/ValidatorNode.php
PropertyTypeDescription
$argumentsarrayreadonly.
$basestringreadonly.
$childrenarrayreadonly.
$declaredNamesarrayreadonly.
$errorsarrayreadonly.
$methodsarrayreadonly.
$namestringreadonly.
$parametersarrayreadonly.
$validatorClassstringreadonly.

public function __construct(string $name, string $validatorClass, array<int|string, mixed> $arguments, string $base, array<string, mixed> $parameters, array<int|string, mixed> $errors, array<string> $methods, array<string> $declaredNames, array<ValidatorNode> $children = []): mixed

Nested validators (and/or/not/xor containers).

ParameterTypeDescription
$namestringThe validator’s name (explicit or generated).
$validatorClassstringThe resolved, fully-qualified validator class.
$arguments`array<int“string, mixed>`
$basestringThe base path from , or ”.
$parametersarray``<``string``, ``mixed``>The fully resolved, already-checked parameter bag.
$errors`array<int“string, mixed>`
$methodsarray``<``string``>The HTTP methods this validator applies to (or [”] for all).
$declaredNamesarray``<``string``>Request parameter names this validator whitelists.
$childrenarray``<ValidatorNode>Nested validators (and/or/not/xor containers).

Returns mixed