-
Notifications
You must be signed in to change notification settings - Fork 773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Roadmap to 3.0 #1447
Comments
Hello, guys. When will you continue working on release 3.0? |
Are there any of these unfinished items you've listed that would be good for a new contributor to handle? We're using this library, and this 3.0 release looks like it will fix some of the issues we've had with it, so I could probably put some time toward a few issues to help get the release out. |
I'm sorry for be belated response, peeps! @dmitriiPopov, I've been working a lot in the last couple of weeks. I'm hoping to release version 3.0 at the beginning of next year. I think it's looking great so far, check this out: https://github.com/Respect/Validation/blob/main/docs/02-feature-guide.md @dmjohnsson23, at the moment it's a bit tricky, because I'm at a phase that I'm myself figuring out how I really want things to work. I got most of the groundwork done, but I'm still seeing how I really want a few rules to work out. Thank you for offering help, though! 🐼 |
@dmjohnsson23, if you (or anyone) could do what I did for Length in #1485 but for Each, Min, and/or Max, that would be very helpful. I've been coding intensely in the past month, I'm gonna take a break until next year, but I will probably be able to review merge requests. |
I'd be happy to give it a go. I looked at the referenced commit and I don't fully understand what all the changes are doing at this point, so I'll need to spend some time figuring out the code. I don't just want to copy/paste the same changes without fully understanding the intent. Any pointers would be welcome. |
I'm doing a lot of stuff like this:
Will this still be valid in 3.0? |
@andus4n, the However, a few things will need to be replaced in your code:
There will be some mechanisms in place that should allow you to run your code if you suppress deprecations. However, even on the current versions, I think your chain could be simpler. I'm not sure why you're calling I think that on version 2.3 (or 2.4), you chain could look like this: ->attribute('foo', v::stringType()->length(1, 19)->digit()->intVal()->setTemplate('This should have been valid...'))
->attribute('bar', v::boolType()->setTemplate('This also should have been valid...')) In version 3.0, it will look like pretty much the same (just changing ->property('foo', v::stringType()->lengthBetween(1, 19)->digit()->intVal()->setTemplate('This should have been valid...'))
->property('bar', v::boolType()->setTemplate('This also should have been valid...')) But, it could be more clear on version 3.0 with the Templated rule, because it's more explicit (IMO) ->property('foo', v::templated(v::stringType()->lengthBetween(1, 19)->digit()->intVal(), 'This should have been valid...'))
->property('bar', v::templated(v::boolType(), 'This also should have been valid...')) |
Thank you for the response.
So basically, if i have a chain like To be more precise:
This won't be a problem. As a side-note, will version 2.2.4 work on PHP 8.4? I think a lot of developers are still using this version. |
By error, I mean that it won't work, because
Oh, I got it. So you're using
I think so! Apart form the |
That sounds really well. |
No worries, it's been removed anyways: https://respect-validation.readthedocs.io/en/2.2/rules/Sf/ |
To-dos
I'm almost there, and there are some awesome improvements coming!
Core
Validator::validate()
that returns an object with errorsResult->isValid
toResult->hasPassed
Simple::isValid
public{{placeholder|quote}}
setName()
withNamed
rulesetTemplate()
withTemplated
ruleCreate class alias for old abstract classesValidator::assert()
ComponentException
extendLogicException
getMessages()
return__self__
setName()
update names, but not IDsRules
Masked
rule -- which allows masking the inputReducer
to an actual ruleAttributes
to deal with inheritanceMax
with subsequents when possibleMin
with subsequents when possibleLength
with subsequents when possibleDateTimeDiff
to generate results with subsequentsUndefOr
andNullOr
KeySet
ruleDateDiff
ruleMinAge
,MaxAge
, andAge
rulesNotOptional
toNotUndef
BetweenExclusive
ruleConsecutive
ruleLazySequence
ruleMax
ruleMin
ruleKeyValue
ruleLength
ruleNullable
toNullOr
Optional
toUndefOr
Max
rule toLessThanOrEqual
Min
rule toGreaterThanOrEqual
Key
rule intoKey
,KeyExists
, andKeyOptional
Property
rule intoProperty
,PropertyExists
, andPropertyOptional
Other
master
tomain
Nice to have
Update validation engine
Here are some "problems" I see with the current engine
assert()
andcheck()
means duplication in some cases.Not
) if there are errors. That means that we have limited granularity control.On version 3.0, this won't be possible anymore:
Instead, you would need to do that:
However, because
assert()
will be available only onValidator
, you could do things like that:The text was updated successfully, but these errors were encountered: