Skip to content
Corex

Max

Corex\Forms\Validation\Rules\Max · class · Forms layer

Upper bound on a number: the value must be ≤ N. An empty value passes (see required for emptiness). A form reaches this rule only for a field that is a number — the number or rating type, or any field declaring numeric. SchemaResolver turns max:N on every other field into {@see MaxLength}, so 2025 in a message is counted, not compared. An answer that is not numeric is measured by its length. Declare numeric to refuse it.

validate(mixed $value, array $params, array $allValues): ?string

Section titled “validate(mixed $value, array $params, array $allValues): ?string”