Skip to content

Releases: BlakvGhost/PHPValidator

v2.3.1 stable

04 Dec 18:11
83aa4e1

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v2.3.0...v2.3.1

v2.3.0 stable

16 Oct 17:32
a83b658

Choose a tag to compare

What's Changed

[2.3.0] - 2025-10-16

New Features

  • validated() method added to the Validator class
    → Returns only validated fields (those without errors).
$validator = new Validator(['name' => 'John', 'age' => null], [
    'name' => 'required',
    'age'  => 'required',
]);
$validator->isValid(); // false
$validator->validated(); // ['name' => 'John']
  • New Rule: not_nullable
    → Ensures a field cannot be null.
    'field' => 'not_nullable'

Improvements

  • ✅ Improved behavior of the nullable rule — it now correctly passes when value is null.
  • Added unit tests for:
    • validated() method
    • not_nullable rule
    • nullable rule consistency
  • Internal refactors for cleaner validation flow and consistent validatedData handling.

Documentation

  • README.md updated
  • Added documentation for validated() method.
  • Added example for not_nullable rule.
  • Simplified header with Markdown-only badges (removed HTML tags).

Summary

Version Date Description
2.3.0 2025-10-16 Added validated() method, not_nullable rule, improved nullable logic
2.2.0 2025-09-?? Internal optimizations and minor bug fixes
2.1.0 2025-08-?? Enhanced rule mapping and multilingual support

Contributing

Found a bug or want to suggest a feature?
Open an issue or submit a pull request — contributions are welcome ❤️

Full Changelog: v2.2.0...v2.3.0

v2.2.0 stable

09 May 17:25

Choose a tag to compare

Features

  • Full support for * wildcards in validation and transformation paths
    Wildcards can now be used in input keys to dynamically apply rules or transformations to deeply nested structures.
    Example:

    {
      "users.*.email": "required|email"
    }
    
  • Improved nested array notation handling
    Deeply nested array structures (e.g., users..addresses..city) are now fully supported across all layers:

    • Validation

    • Transformation

    • Conditional mapping

  • Extended compatibility with hybrid structures using wildcards
    You can now target nested keys inside arrays and objects simultaneously using wildcards.
    Example:

{
  "orders.*.items.*.product.id": "required|numeric"
}

Fixes

  • Fixed a bug where validation rules were not properly applied when using multi-level wildcards.

  • Resolved path conflicts involving explicit array indices combined with wildcards.

Breaking Changes

Validation rules using wildcard paths are now strictly interpreted, which may affect previously lenient or permissive behavior.

Full Changelog: v2.1.0...v2.2.0

v2.1.0 stable

18 May 16:49

Choose a tag to compare

  • Implemented NotRequiredWithRule to ensure a field is not required if another specified field is present.
  • Added passes method to validate the rule logic.
  • Included message method to provide appropriate error messages using LangManager.
  • Updated documentation and comments for clarity.

This rule is the inverse of RequiredWithRule, providing more flexible validation options.

Full Changelog: v2.0.2...v2.1.0

v2.0.2 stable

18 May 15:30

Choose a tag to compare

  • Set empty field to blank string before validation

Addresses bug where validation fails on non-required fields
that are not present in the data. By initializing missing
fields to an empty string, validation rules like min, max,
size, etc. can be properly applied without triggering an
error due to an undefined index.

Fixes #124
Full Changelog: v2.0.1...v2.0.2

v2.0.1 stable

18 May 14:53

Choose a tag to compare

What's Changed

  • Fix required rule validation for missing fields by @BlakvGhost in #14

Full Changelog: v2.0.0...v2.0.1

v2.0.0 stable

09 Dec 13:19
8195f32

Choose a tag to compare

What's Changed

  • Add feature to add default language for validation message by @BlakvGhost in #13

Full Changelog: v1.4.1...v2.0.0

v1.4 stable

22 Nov 15:59
d57663e

Choose a tag to compare

What's Changed

  • Update max length algo to work with file and array type by @BlakvGhost in #12

Full Changelog: v1.4...v1.4.1

v1.4 stable

21 Nov 02:17
79a7978

Choose a tag to compare

What's Changed

  • Fix custom rule interface namespace issues in Validator by @BlakvGhost in #11

Full Changelog: v1.3.2...v1.4

v1.3 stable

19 Nov 17:03
697e4cc

Choose a tag to compare

What's Changed

Full Changelog: v1.3...v1.3.2