ScalarVal

February 3, 2026 · View on GitHub

  • ScalarVal()

Validates whether the input is a scalar value or not.

v::scalarVal()->assert(135.0);
// Validation passes successfully

v::scalarVal()->assert([]);
// → `[]` must be a scalar

Templates

ScalarVal::TEMPLATE_STANDARD

ModeTemplate
default{{subject}} must be a scalar
inverted{{subject}} must not be a scalar

Template placeholders

PlaceholderDescription
subjectThe validated input or the custom validator name (if specified).

Categorization

  • Types

Changelog

VersionDescription
3.0.0Templates changed
1.0.0Created

See Also