Skip to content

[Validator] Add support for ConstraintViolationList::createFromMessage() #41154

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

Merged
merged 1 commit into from
Jul 3, 2021

Conversation

lyrixx
Copy link
Member

@lyrixx lyrixx commented May 10, 2021

Q A
Branch? 5.x (5.4)
Bug fix? no
New feature? ye
Deprecations? no
Tickets Fix #41111
License MIT
Doc PR

Copy link
Contributor

@ro0NL ro0NL left a comment

Choose a reason for hiding this comment

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

ConstraintViolationList::createFromMessage('my message')->addAll(
  ConstraintViolationList::createFromMessage('my other message')
)

we may add a named constructor for ConstraintViolation later 👍

im wondering if we should imply a message template, thus extra arg for params 🤔

(meant to comment =))

@fabpot
Copy link
Member

fabpot commented Jul 3, 2021

Thank you @lyrixx.

@fabpot fabpot merged commit 0ff660c into symfony:5.4 Jul 3, 2021
@lyrixx lyrixx deleted the validator-shortcut branch July 5, 2021 08:30
This was referenced Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Validator] Add shortcut to create a new ConstraintViolationList with one Constraint
5 participants