feat: Import symfony/validator - #63556
Open
CarlSchwan wants to merge 1 commit into
Open
Conversation
CarlSchwan
requested review from
come-nc,
provokateurin,
salmart-dev and
sorbaugh
and removed request for
a team
August 25, 2026 08:36
come-nc
reviewed
Aug 25, 2026
| message: (string)$violation->getMessage(), | ||
| invalidValue: $violation->getInvalidValue(), | ||
| ), | ||
| iterator_to_array($violations), |
Contributor
There was a problem hiding this comment.
It’s sad to flatten the iterator. Maybe foreach+yield instead?
Member
Author
There was a problem hiding this comment.
at the same time, returning a generator in a validate method is not great as in most case, we want to know if the returned list is empty or not
| use OC\User\Listeners\UserChangedListener; | ||
| use OC\User\Session; | ||
| use OC\User\User; | ||
| use OC\Validator\Validator as ConstraintValidator; |
Contributor
There was a problem hiding this comment.
Then call the class ConstraintValidator 😛
It’s best to have names that we understand without the namespace as it’s how we use them most of the time.
CarlSchwan
force-pushed
the
carl/validator
branch
from
August 25, 2026 14:11
3c102a7 to
dfc132a
Compare
CarlSchwan
requested review from
a team,
miaulalala and
nickvergessen
as code owners
August 25, 2026 14:11
CarlSchwan
requested review from
kristian-zendato and
skjnldsv
and removed request for
a team
August 25, 2026 14:11
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
CarlSchwan
force-pushed
the
carl/validator
branch
from
August 25, 2026 14:27
dfc132a to
d4a2ec7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Allow to validate DTO objects based on constraints.
TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)