Skip to content

Comments

Update dependency respect/validation to v3#24

Merged
kynx merged 2 commits intomainfrom
renovate/respect-validation-3.x
Feb 15, 2026
Merged

Update dependency respect/validation to v3#24
kynx merged 2 commits intomainfrom
renovate/respect-validation-3.x

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Feb 9, 2026

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
respect/validation (source) ^2.4^2.4 || ^3.0 age adoption passing confidence

Release Notes

Respect/Validation (respect/validation)

v3.0.1

Compare Source

v3.0.0

Compare Source

Respect\Validation 3.0

Respect\Validation 3.0 is a major release with breaking changes, improved performance, and new features for more flexible validation. This version requires PHP 8.5+ (up from 8.1+ in 2.x). Update via:

composer require respect/validation:^3.0

For detailed migration instructions, see the Migration Guide.

Breaking Changes

  • Class and Namespace Renames:
    • Validator renamed to ValidatorBuilder
    • Rules namespace to Validators
    • Rule interface to Validator
    • Factory to ValidatorFactory
    • InvalidRuleConstructorException to InvalidValidatorException.
  • Validation Methods:
    • validate() now returns a ResultQuery object instead of a boolean (use isValid() for boolean checks)
    • check() and assert() now throw a unified ValidationException (validator-specific exceptions removed; NestedValidationException removed).
  • Removed Validators:
    • Type (use specific type validators like stringType())
    • Yes/No (use trueVal()/falseVal())
    • KeyNested (use nested key())
    • Age/MinAge/MaxAge (use dateTimeDiff())
    • PrimeNumber/Fibonacci/PerfectSquare/FilterVar/Uploaded (use satisfies())
    • VideoUrl (no direct replacement).
  • Behavior Changes:
    • Attribute replaced by Property/PropertyOptional/PropertyExists
    • Key split into Key/KeyOptional/KeyExists
    • Length and Size signatures changed to use composition (e.g., length(v::between(5, 10)))
    • Each stricter (rejects non-iterables like stdClass)
    • Composite validators (AllOf, etc.) require at least two validators
    • After (ex-Call) no longer handles callback errors
    • Contains/ContainsAny/In/EndsWith/StartsWith now strict by default
    • Url validates domains/IPs, drops news scheme, adds Email for mailto
    • New dependencies for some validators (sokil/php-isocodes, ramsey/uuid).
  • Renamed Validators:
    • Call to After
    • Callback to Satisfies
    • Min to GreaterThanOrEqual
    • Max to LessThanOrEqual
    • Nullable to NullOr
    • Optional to UndefOr
    • KeyValue to Factory
    • NotBlank inverted to Blank (use not(v::blank()))
    • NotEmpty inverted/renamed to Falsy (use not(v::falsy()))
    • NoWhitespace inverted/renamed to Spaced (use not(v::spaced()))
    • IterableType to IterableVal (stricter IterableType now exists separately).
  • Custom Messages:
    • setTemplate() and setName() removed (use templated() and named())
    • {{name}} placeholder renamed to {{subject}}.
  • Factory/Container: Factory replaced by PSR-11 container via ContainerRegistry.
  • Custom Validators: No longer need separate exception classes
    • use #[Template] attributes on validator classes.

New Features

  • Result-Based Validation: validate() returns a ResultQuery for detailed error inspection.

    $result = v::numericVal()->positive()->between(1, 255)->validate($input);
    $result->hasFailed(); // bool
    $result->getFullMessage(); // All errors as tree
  • Attribute Validation: Validate object properties via PHP attributes.

    class User {
        #[Validators\Email] public string $email;
        #[Validators\Between(18, 120)] public int $age;
    }
    v::attributes()->assert($user); // Validates all annotated properties
  • ShortCircuit Validation: Stops at first failure for dependent checks.

    v::shortCircuit(
        v::key('countryCode', v::countryCode()),
        v::factory(fn($input) => v::key('subdivisionCode', v::subdivisionCode($input['countryCode'])))
    )->assert(['countryCode' => 'US', 'subdivisionCode' => 'CA']); // Passes
  • Dynamic Factory Validators: Create validators based on input.

    v::factory(fn($input) => v::key('confirmation', v::equals($input['password'] ?? null)))
        ->assert(['password' => 'secret', 'confirmation' => 'secret']); // Passes
  • Prefixed Shortcuts: Convenient wrappers for common patterns.

    v::nullOrEmail()->assert(null); // Passes
    v::allPositive()->assert([1, 2, 3]); // Passes
    v::notBlank()->assert('hello'); // Passes
  • Result Composition: Nested results for clearer messages (e.g., all(v::intType()) → "Every item must be an integer").

  • Paths in Errors: Full dot-notation paths for nested failures (e.g., .mysql.host must be a string).

  • Helpful Stack Traces: Traces point to user code, not library internals.

  • Custom Exceptions: Pass exceptions to assert().

    v::email()->assert($input, new DomainException('Invalid email'));
  • Placeholder Pipes: Customize template rendering (e.g., {{haystack|list:or}} → "active" or "pending").

  • Symfony Translation: Uses Symfony contracts for message translation.

  • New Validators: All, BetweenExclusive, ContainsCount, DateTimeDiff, Formatted, Hetu, KeyExists, KeyOptional, Named, PropertyExists, PropertyOptional, Templated.

For more details, see the Feature Guide, Validators List, or open an issue on GitHub.

v2.4.12

Compare Source

v2.4.11

Compare Source

v2.4.10

Compare Source

v2.4.9

Compare Source

v2.4.8

Compare Source

v2.4.7

Compare Source

v2.4.6

Compare Source

v2.4.5: Fix issues with PHP 8.5

Compare Source


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

Read more information about the use of Renovate Bot within Laminas.

@renovate renovate bot added the renovate label Feb 9, 2026
@renovate
Copy link
Contributor Author

renovate bot commented Feb 9, 2026

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: composer.lock
Command failed: composer update respect/validation:3.0.1 --with-dependencies --ignore-platform-req=ext-* --ignore-platform-req=lib-* --no-ansi --no-interaction --no-scripts --no-autoloader --no-plugins --minimal-changes
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires respect/validation ^2.4 || ^3.0, found respect/validation[2.4.0, ..., 2.4.12, 3.0.0, 3.0.1] but these were not loaded, likely because it conflicts with another require.
  Problem 2
    - league/openapi-psr7-validator is locked to version 0.22 and an update of this package was not requested.
    - league/openapi-psr7-validator 0.22 requires respect/validation ^1.1.3 || ^2.0 -> found respect/validation[1.1.3, ..., 1.1.31, 2.0.0, ..., 2.4.12] but it conflicts with your temporary update constraint (respect/validation:3.0.1).

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

| datasource | package            | from  | to    |
| ---------- | ------------------ | ----- | ----- |
| packagist  | respect/validation | 2.4.4 | 3.0.1 |


Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@renovate renovate bot force-pushed the renovate/respect-validation-3.x branch from e65096a to 1a4a38f Compare February 15, 2026 14:27
@kynx kynx merged commit 46dc39b into main Feb 15, 2026
21 checks passed
@kynx kynx deleted the renovate/respect-validation-3.x branch February 15, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant