Releases: BlakvGhost/PHPValidator
v2.3.1 stable
What's Changed
- Allow
nullablerule to ignore subsequent rules if data is missing by @ollyollyollyltd in #21
New Contributors
- @ollyollyollyltd made their first contribution in #21
Full Changelog: v2.3.0...v2.3.1
v2.3.0 stable
What's Changed
[2.3.0] - 2025-10-16
New Features
validated()method added to theValidatorclass
→ 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 benull.'field' => 'not_nullable'
Improvements
- ✅ Improved behavior of the
nullablerule — it now correctly passes when value is null. - Added unit tests for:
validated()methodnot_nullablerulenullablerule consistency
- Internal refactors for cleaner validation flow and consistent
validatedDatahandling.
Documentation
- README.md updated
- Added documentation for
validated()method. - Added example for
not_nullablerule. - 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
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
- 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
- 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
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
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
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
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
What's Changed
- Changing the username for download number recovery by @BlakvGhost in #8
- Edit readme with logo by @BlakvGhost in #9
- Add custom error message and review folder architecture by @BlakvGhost in #10
Full Changelog: v1.3...v1.3.2