Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 14, 2025

Bumps respect/validation from 2.3.9 to 2.4.0.

Release notes

Sourced from respect/validation's releases.

First release of the 2.4 series

This release just deprecates a few things to prepare users to the next major version. Migrating to this release will probably make migrating to version 3.0 a bit less painful, but feel free to skip this version as it has no new features.

Deprecations

Here are a few important changes coming into version 3.0.

Method validate() is now called isValid()

The method validate() will be repurposed to return an object with failures, so users can iterate over them and get more detailed information about the validation that just occurred.

Consider changing your code as indicated below:

- v::stringType()->validate($input)
+ v::stringType()->isValid($input)

In most cases, a single find and replace from your IDE should fix it. You could also run a a few commands in your command line to fix that too; here's an example:

rg '\->validate\(' --files-with-matches |
    xargs -n 1 sed --in-place 's,->validate(,->isValid(,g'

WARNING: the commands above will replace any method that is called validate in your codebase. Make sure that you only call the method validate from this library.

Calling rules directly

All existing methods in the class rules rules will be removed in favor of a single method that will return an object with the validation result. That will help us with providing more granularity control, more flexibility, and more rich and customisable validation messages.

Consider changing your code as indicated below:

Calling assert():

- (new Email())->assert($input)
+ Validator::create(new Email())->assert($input)

Calling check():

- (new Email())->check($input)
+ Validator::create(new Email())->check($input)

Calling validate():

- (new Email())->validate($input)
+ Validator::create(new Email())->isValid($input)
</tr></table> 

... (truncated)

Commits
  • 48b38bd Update Codecov settings
  • 8d989a7 Create a few classes the will be present in the next version
  • 3c04d1d Deprecate all exception classes
  • 9740e24 Prepare library for the next major version
  • 37736c4 Update Regional Information
  • 9045f65 Fix wrong type received by "KeySet" rule
  • 294c36f Update Regional Information
  • 39d604c Update Regional Information
  • See full diff in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [respect/validation](https://github.com/Respect/Validation) from 2.3.9 to 2.4.0.
- [Release notes](https://github.com/Respect/Validation/releases)
- [Changelog](https://github.com/Respect/Validation/blob/2.4/CHANGELOG.md)
- [Commits](Respect/Validation@2.3.9...2.4.0)

---
updated-dependencies:
- dependency-name: respect/validation
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file php Pull requests that update Php code labels Jan 14, 2025
@sonarqubecloud
Copy link

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

Labels

dependencies Pull requests that update a dependency file php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant