Skip to content

Upgrading from 3.x to 4.x: migrating ValidationData with $currentTime #813

Answered by lcobucci
ozahorulia asked this question in Q&A
Discussion options

You must be logged in to vote

@hast sorry about our delay here... I converted your issue into a discussion to make it easier for other people to find it.

From the upgrading steps I can see that validation is now done like this:

!$this->configuration->validator()->validate($token, ...$this->configuration->validationConstraints())

That's the suggested approach for simple validation, you can make do all sorts of things here...

The v3.x behaviour is similar to what we implemented in the LooseValidAt constraint.
The difference is that we use a clock instead of an integer to perform the validation.

Your code would look like this (this is just a sample, sure):

use Lcobucci\Clock\Clock;
use Lcobucci\Clock\SystemClock;
use L…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ozahorulia
Comment options

Answer selected by ozahorulia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #812 on January 10, 2022 21:11.