Skip to content

Instantly share code, notes, and snippets.

@alganet
Created February 9, 2026 16:41
Show Gist options
  • Select an option

  • Save alganet/67ae7a0448dfc40e6e79f5e85fbf835a to your computer and use it in GitHub Desktop.

Select an option

Save alganet/67ae7a0448dfc40e6e79f5e85fbf835a to your computer and use it in GitHub Desktop.
Release Notes

Respect\Validation v3.0

Version 3.0 is a major release that modernizes the API, improves error handling, and introduces powerful new validation features. This release contains breaking changes and requires migration efforts from v2.x.

Breaking Changes

  • PHP 8.5+ required (v2.x required PHP 8.1+)
  • Main entry point renamed to ValidatorBuilder (global v alias available)
  • Unified ValidationException (validator-specific and nested exceptions removed)
  • validate() now returns a ResultQuery object
    • Use isValid() for boolean checks
  • Significant validator changes:
    • Attribute replaced by Property, PropertyOptional, PropertyExists
    • Key split into Key, KeyOptional, KeyExists
    • Min / Max semantics changed
    • NotBlank, NotEmpty, NoWhitespace logic inverted (with new shortcuts)
    • Length and Size now use composition instead of scalar arguments
  • Several validators removed or renamed (Type, Yes, No, Age, KeyNested, etc.)
  • Custom message methods setName() and setTemplate() removed
  • Validator factory replaced by a DI container via ContainerRegistry
  • Custom validators now define message templates using PHP attributes

New Features

  • Result-based validation API with rich inspection tools
    • Find errors by path, name, or validator ID
  • New validators, including:
    • Attributes, All, BetweenExclusive, DateTimeDiff
    • ShortCircuit, Formatted, ContainsCount
    • Factory, Named, Templated
  • Prefixed shortcuts for common patterns
    (nullOrEmail, allPositive, keyEmail, notBlank, etc.)
  • Improved error messages with full paths for nested data
  • Cleaner stack traces that point to user code
  • Symfony Translation Contracts support
  • Template placeholder pipes for advanced message formatting

Optional Dependencies

Some validators now require additional packages (e.g. ISO code validators, UUID support).


Please review the full migration guide in the docs/ folder before upgrading. Feel free to report any issues or problems you encounter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment