Skip to content

Validator

Everything under Quiote\Validator.

ClassDescription
AndoperatorValidatorANDOperatorValidator only succeeds if all sub-validators succeeded Parameters: ‘skip_errors’ do not submit errors of child validators to validator manager ‘break’ break the execution of child validators after first failure
ArraylengthValidatorArraylengthValidator verifies the length (count()) constraints for an array Parameters: ‘min’ The array should contain at least ‘min’ elements ‘max’ The array should contain at most ‘max’ elements
BaseFileValidatorBaseFileValidator is the base validator when validating files.
BooleanValidatorBooleanValidator verifies a parameter is a valid boolean Accepted values are string 0/1, int 0/1, bool true/false, string yes/no, string true/false, string on/off - basically all values that Toolkit::literalize() will accept.
DateTimeValidatorDateTimeValidator verifies that a parameter is of a date and/or time format using native \DateTimeImmutable and IntlDateFormatter APIs.
DependencyManagerDependencyManager handles the dependencies in the validation process
EmailValidatorEmailValidator verifies if a parameter contains a value that qualifies as an email address.
EqualsValidatorEqualsValidator verifies if a parameter equals to a given value The input is compared to a value and the validator fails if they differ.
FileValidatorFileValidator verifies the size and extension of a file
ImageFileValidatorImageFileValidator verifies a parameter is an uploaded image Parameters: ‘min_width’ The minimum width of the image ‘max_width’ The maximum width of the image ‘min_height’ The minimum height of the image ‘max_height’ The maximum height of the image ‘format’ list of valid formats (gif,jpeg,png,bmp,psd,swf) Errors: ‘no_image’ The uploaded file is no image ‘min_width’ ‘max_width’ ‘min_height’ ‘max_height’ ‘format’ The image was not in the required format
InarrayValidatorInArrayValidator verifies whether an input is one of a set of values Parameters: ‘values’ list of values that form the array ‘sep’ separator of values in the list ‘case’ verifies case sensitive if true ‘strict’ whether or not to do strict type comparisons with in_array()
IsNotEmptyValidatorIsNotEmptyValidator verifies a parameter is not empty The content of the input value is not verified in any manner, it is only checked if the input value exists and is not empty.
IssetValidatorIssetValidator verifies a parameter is set The content of the input value is not verified in any manner, it is only checked if the input value exists.
JsonValidatorJsonValidator verifies if a parameter contains a value that is valid JSON.
NotoperatorValidatorNOTOperatorValidator succeeds if the sub-validator failed Parameters: ‘skip_errors’ do not submit errors of child validators to validator manager
NumberValidatorNumberValidator verifies that a parameter is a number and allows you to apply size constraints.
OperatorValidatorOperatorValidator Operators group a couple if validators…
OroperatorValidatorOROperatorValidator succeeds if at least one sub-validators succeeded Parameters: ‘skip_errors’ do not submit errors of child validators to validator manager ‘break’ break the execution of child validators after first success
RegexValidatorRegexValidator allows you to match a value against a regular expression pattern.
SetValidatorSetValidator only exports a value and always succeeds Parameters: ‘value’ value that should be exported
StringValidatorStringValidator allows you to apply string-related constraints to a parameter.
ValidationArgumentValidationArgument is a tuple of argument name and source that specifies the argument to validate.
ValidationErrorValidationError stores an error message and the fields of an error.
ValidationIncidentValidationIncident is erroneous result of an validation run.
ValidationManagerValidationManager provides management for request parameters and their associated validators.
ValidationReportValidationReport stores the result of a validation run.
ValidationReportQueryValidationReportQuery allows queries against the validation run report.
ValidatorValidator allows you to validate input Parameters for use in most validators: ‘name’ name of validator ‘base’ base path for validation of arrays ‘arguments’ an array of input parameter keys to validate ‘export’ destination for exported data ‘depends’ list of dependencies needed by the validator ‘provides’ list of dependencies the validator provides after success ‘severity’ error severity in case of failure ‘error’ error message when validation fails ‘errors’ an array of errors with the reason as key ‘required’ if true the validator will fail when the input parameter is not set
ValidatorFactoryBuilds a validator from its class name.
XoroperatorValidatorXOROperatorValidator succeeds if only one of two sub-validators succeeded Parameters: ‘skip_errors’ don’t submit errors of child validators to validator manager
InterfaceDescription
IValidationReportQueryIValidationReportQuery allows queries against the validation run report.
IValidatorContainerIValidatorContainer is an interface for classes which contains several child validators
ValidatorInterfaceWhat a validator container asks of a validator: configure it, run it against a request, and read back what it named, decided and exported.
NamespaceContents
Compiler16 types