final class RuleCompiler

Compile pipe-string or array rules into an AttributePlan.

Each rule part becomes either an InlineCheck (fast, match-dispatched) or a DelegatedCheck (calls existing validate*() methods). The compiler resolves sibling context (size mode, date format, array presence) to bake compile-time decisions into check params.

Methods

static AttributePlan
compile(array $rules)

Compile a per-attribute rule array into an AttributePlan with inlining.

static AttributePlan
compileAllDelegated(array $rules)

Compile all rules as DelegatedCheck (no inlining).

Details

at line 29
static AttributePlan compile(array $rules)

Compile a per-attribute rule array into an AttributePlan with inlining.

Used for the base Validator class. Subclasses use compileAllDelegated().

Parameters

array $rules

As produced by ValidationRuleParser::explode()

Return Value

AttributePlan

at line 52
static AttributePlan compileAllDelegated(array $rules)

Compile all rules as DelegatedCheck (no inlining).

Used for Validator subclasses which may override validate*() methods. Shares the same flag pre-resolution so the execution loop's attribute-level logic (sometimes, excluded) still works.

Parameters

array $rules

As produced by ValidationRuleParser::explode()

Return Value

AttributePlan