Releases: EnrickyHip/php-request-validator
Releases · EnrickyHip/php-request-validator
Release list
3.0.1
3.0.0
- Separate common methods between
FieldValidatorandArrayValidatorin a trait; - Change
ArrayValidatorparent fromFieldValidatortoValidator; - Rename
RequestValidator::requireOr()parameter$validatorsto$fieldsand allow receiving an array of string with the name of the field instead of the validators; - Allow instanciate
RequestValidatorto add rules directly, without need to create a separate class; - Remove need to return array of validators on
RequestValidatot::rules(); - Random bug fixes.
2.1.0
- add union types checking
- modify return type of ArrayValidator methods from self to static
- modify ArrayValidator's parent from FieldValidator to Validator
- rename requireOr() parameter 'validators' to 'fields' and receive a an array of strings instead of array of validators.
2.0.3
Fix incompatibility of ArrayValidator method's return type with FieldValidators method's.
2.0.2
Fix return type of FieldValidator methods when usnig ArrayValidator.
2.0.1
Replace :value placeholder by the element value instead of [array] for error messages in array validators.
2.0.0
- Add DataType ArrayOf to be used as a type. Also allowing to define a type for its elements;
- Add isArray rule to force a field to be an array;
- Adapt min() and max() methods to validate arrays length;
- Create method RequestValidator::validateArray() with specific methods to validate arrays (minLength, maxLength);
- Add notEmpty rule to force a field to not be empty.
1.0.2
- Fix unique error messages array
- Create Data Type ArrayOf to allow checking if a field is an array
1.0.1
Fix bug of checking if field is a valid file when it is not sent
PHP - Request Validator 1.0.0
- Fix type annotations;
- Rename IsDateTimeRule to IsDateStringRule;
- Add type checking on rules which need string values to prevent runtime errors (MatchRule, IsUrlRule and IsDateStringRule);
- Create facade methods to all built-in rules;
- Rename "value" and "name" placeholders to ":value" and ":name";
- Add non-strict mode for type checking;
- Add Validator::requireOr() method which allows to define a group of rules to an attribute where at least one of them should be valid.