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 (numeric semantics, date format, array presence) to bake compile-time decisions into check params.

Methods

static AttributePlan
compile(array $rules, array $numericRules)

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 30
static AttributePlan compile(array $rules, array $numericRules)

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()

array $numericRules

Rules which activate numeric size semantics

Return Value

AttributePlan

at line 65
static AttributePlan compileAllDelegated(array $rules)

Compile all rules as DelegatedCheck (no inlining).

Used for Validator subclasses. Retains meta flags for attribute-level gating while keeping every declared rule available to delegated execution.

Parameters

array $rules

As produced by ValidationRuleParser::explode()

Return Value

AttributePlan