Skip to content

feat: Import symfony/validator - #63556

Open
CarlSchwan wants to merge 1 commit into
carl/serializerfrom
carl/validator
Open

feat: Import symfony/validator#63556
CarlSchwan wants to merge 1 commit into
carl/serializerfrom
carl/validator

Conversation

@CarlSchwan

@CarlSchwan CarlSchwan commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

Allow to validate DTO objects based on constraints.

TODO

  • ...

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@CarlSchwan CarlSchwan added this to the Nextcloud 36 milestone Aug 25, 2026
@CarlSchwan CarlSchwan self-assigned this Aug 25, 2026
@CarlSchwan
CarlSchwan requested a review from a team as a code owner August 25, 2026 08:36
@CarlSchwan CarlSchwan added the 3. to review Waiting for reviews label Aug 25, 2026
@CarlSchwan
CarlSchwan requested review from come-nc, provokateurin, salmart-dev and sorbaugh and removed request for a team August 25, 2026 08:36
message: (string)$violation->getMessage(),
invalidValue: $violation->getInvalidValue(),
),
iterator_to_array($violations),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s sad to flatten the iterator. Maybe foreach+yield instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread lib/private/Server.php Outdated
use OC\User\Listeners\UserChangedListener;
use OC\User\Session;
use OC\User\User;
use OC\Validator\Validator as ConstraintValidator;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants