Skip to content

v2.0.0

Choose a tag to compare

@SoloPHP SoloPHP released this 08 Feb 18:22
· 21 commits to main since this release

Major Changes

  • Complete architecture redesign for better flexibility and maintainability
  • New validation system now supports batch validation of multiple fields and rules
  • Added support for custom validation rules via addCustomRule() method
  • Improved error handling with multiple errors per field

New Features

  1. Batch Validation

    • New validate() method now accepts array of data and rules
    • Support for multiple validation rules using pipe syntax (e.g., 'required|email|min:8')
    • Parameter support in validation rules (e.g., 'min:8')
  2. Custom Rules

    • New addCustomRule() method for extending validation capabilities
    • Custom rules can access full data context during validation
  3. Enhanced Error Handling

    • Multiple error messages per field (array-based storage)
    • Flexible message customization with field-specific overrides
    • Hierarchical message resolution (field.rule > rule > default)
  4. New Methods

    • passed(): Check if validation passed
    • fails(): Check if validation failed
    • errors(): Get all validation errors

Breaking Changes

  • Complete API overhaul - not backward compatible with 1.x
  • Changed validation method signature
  • New error storage structure (array-based instead of single message)
  • Removed ValidationMessages class in favor of direct message array handling

Technical Improvements

  • Strict typing enabled with declare(strict_types=1)
  • Better separation of concerns
  • More flexible rule parameter handling
  • Improved message templating system