ConditionMap
in package
FinalYes
Condition-map resolver (expressions.md §8). A thin wrapper over the expression engine — NOT a separate parser.
A condition map is an ordered {expr: value, …}. Keys (each an §2 expression)
are evaluated in declaration order; the first truthy key's value wins. On a
miss the literal true key's value is used if present, else null. PHP assoc
arrays preserve insertion order, so declaration order survives natively.
The true default key is the literal expression true (always truthy); R4
forbids convention sigils such as _. The map's value is returned verbatim
(boolean | string | number | null) — the call site decides the expected type.
Table of Contents
Constants
- DEFAULT_KEY : mixed = 'true'
Methods
- resolve() : mixed
- Resolve a condition map against form data.
Constants
DEFAULT_KEY
public
mixed
DEFAULT_KEY
= 'true'
Methods
resolve()
Resolve a condition map against form data.
public
static resolve(array<string, mixed> $map, array<string, mixed> $formData[, array<int, string> $currentPath = [] ][, array<int, int> $rowKeys = [] ]) : mixed
Parameters
- $map : array<string, mixed>
-
ordered expr => value
- $formData : array<string, mixed>
- $currentPath : array<int, string> = []
- $rowKeys : array<int, int> = []
-
positions of the row keys in $currentPath