Validating numeric data
Namespace: Sphp \ Validators
These validators validate float and int data
SmallerThan is lower bound validator: the length of the input must be atleast a given limit.
GreaterThan is upper bound validator: the length of the input must be below a given limit.
Between validator: value must be between the lower and upper limits.
Predefined errormessage Template formatting parameters:
:value - the string representation of the validated $value
:type - the datatype of the validated $value
:type = "boolean" - for boolean type
:type = "integer" - for integer type
:type = "float" - for float type
:type = "string" - for string type
:type = "array" - for array type
:type = "object" - for object type
:type = "resource" - for resource type
:type = "resource (closed)" - for closed resource type
:type = "NULL" - for nulls
:type = "unknown type" - for unknown types
:strict-type - the strict datatype of the validated $value differs from :type
any object corresponds to the name of the class get_class() results
The Between validator validates whether numeric input is between two numbers. This range is either inclusive or exclusive.
Validator specific predefined errormessage Template formatting parameters:
:min - the minumum allowed value of the validated $value
:max - the maximum allowed value of the validated $value
Synopsis
Methods: public __construct ( float $min ,
float $max ,
bool $inclusive = true )
The SmallerThan validator validates whether a float or an int input is msaller than or equal to a treshold value.
Validator specific predefined errormessage Template formatting parameters:
:max - the maximum allowed value of the validated $value
The GreaterThan validator validates whether a float or an int input is greater than or equal to a treshold value.
Validator specific predefined errormessage Template formatting parameters:
:min - the minumum allowed value of the validated $value