Skip to content

Releases: EnrickyHip/php-request-validator

3.0.1

Choose a tag to compare

@EnrickyHip EnrickyHip released this 03 Jul 13:21

Update PHPDocs.

3.0.0

Choose a tag to compare

@EnrickyHip EnrickyHip released this 03 Jul 12:39
  • Separate common methods between FieldValidator and ArrayValidator in a trait;
  • Change ArrayValidator parent from FieldValidator to Validator;
  • Rename RequestValidator::requireOr() parameter $validators to $fields and allow receiving an array of string with the name of the field instead of the validators;
  • Allow instanciate RequestValidator to 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

Choose a tag to compare

@EnrickyHip EnrickyHip released this 01 Nov 23:29
  • 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

Choose a tag to compare

@EnrickyHip EnrickyHip released this 21 Aug 13:59

Fix incompatibility of ArrayValidator method's return type with FieldValidators method's.

2.0.2

Choose a tag to compare

@EnrickyHip EnrickyHip released this 21 Aug 13:52

Fix return type of FieldValidator methods when usnig ArrayValidator.

2.0.1

Choose a tag to compare

@EnrickyHip EnrickyHip released this 21 Aug 13:45

Replace :value placeholder by the element value instead of [array] for error messages in array validators.

2.0.0

Choose a tag to compare

@EnrickyHip EnrickyHip released this 10 Aug 00:13
  • 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

Choose a tag to compare

@EnrickyHip EnrickyHip released this 18 Jul 17:10
  • Fix unique error messages array
  • Create Data Type ArrayOf to allow checking if a field is an array

1.0.1

Choose a tag to compare

@EnrickyHip EnrickyHip released this 13 Jul 13:23

Fix bug of checking if field is a valid file when it is not sent

PHP - Request Validator 1.0.0

Choose a tag to compare

@EnrickyHip EnrickyHip released this 30 Jun 17:43
  • 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.