Rules
Table of Contents
Interfaces
- RuleInterface
- Interface for validation rules.
Classes
- Accept
- Accept validation rule.
- BoundFrom
- The bound of the minFrom and maxFrom rules (CUVR-079): a finite number value against the value of the referenced
field; a missing or null bound declares none, and a boolean is no number.
- ConditionTree
- Condition tree: a value passes when it is a group `{all: [...]}` or `{any: [...]}`, a field comparison
`{field, op, value}` or, under the parameter `judge`, a judged text `{judge}`, at most 32 levels deep
(schema.md, "Condition trees"). A JSON object is a stdClass or a non-empty associative array, a list a
list array. The check reads no level below the limit.
- ContainedIn
- Contained In validation rule (CUVR-075).
- CountRule
- A rule on the count of the value (array elements, object keys, 0 for a missing or blank value, 1 for another
scalar), which is its measure.
- Date
- Date validation rule.
- DateISO
- ISO Date validation rule.
- Digits
- Digits: a string or number whose canonical text (a string trimmed) is ASCII digits passes.
- Email
- Email format validation rule.
- EndDate
- End Date validation rule.
- EqualTo
- Equal To validation rule.
- FlagRule
- A rule whose parameter is a boolean flag: the flag false switches the rule off, and with the flag on the rule
accepts or rejects the value.
- In
- Membership validation rule: the value is one of the declared members.
- LengthRule
- A rule on the length of the canonical text of the value in code points, which is its measure: an array or object
value has none.
- Max
- Inclusive upper bound: a numeric value not above the bound passes; any other value fails.
- MaxCount
- Maximum collection size: array elements, object keys, 0 for a missing or blank value, 1 for another scalar.
- MaxFrom
- Max From validation rule (CUVR-079).
- MaxLength
- Maximum length validation rule on the code points of the canonical text.
- MeasuredRule
- A rule on a measure of the value (its number, its length or its count): a value without a measure fails, and the
rule decides for a measure.
- Min
- Inclusive lower bound: a numeric value not below the bound passes; any other value fails.
- MinCount
- Minimum collection size: array elements, object keys, 0 for a missing or blank value, 1 for another scalar.
- MinFrom
- Min From validation rule (CUVR-079).
- MinLength
- Minimum length validation rule on the code points of the canonical text.
- NotEqual
- Not Equal validation rule.
- Number
- Number: a numeric value passes; any other value fails.
- NumericRule
- A rule on the numeric value of the value, which is its measure.
- ParameterRule
- A rule with a parameter: the rule reads and checks the parameter first, so a parameter outside the
validation rules fails before the value is looked at, and then decides whether the value holds.
- Pattern
- Whole-value pattern rule, registered as both `pattern` and `match`.
- Range
- Inclusive numeric range: a numeric value within [minimum, maximum] passes; any other value fails.
- RangeLength
- Range length validation rule on the code points of the canonical text.
- ReferenceRule
- A rule that compares a value with the value of another field: a missing or empty parameter
switches it off, the parameter names the other field, and the rule itself compares the two.
- Required
- Required field validation rule: an empty value fails.
- Step
- Step: a numeric value that is an exact integer multiple of the step, counted from 0, passes; any other value fails.
- StringRule
- A rule on the text of a string: a parameter of false switches it off, a value that is not a
string fails, and the string is accepted or not by the rule itself.
- TypeFrom
- Type From validation rule (CUVR-077).
- Url
- URL validation rule.