Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Validator] Allow multiple atPath() on ConstraintViolationBuilder #36553

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

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
🐛 #36544 [Validator] Fix single path issue.
  • Loading branch information
ABGEO committed Apr 25, 2020
commit 8675f3accb0ed8e0feb1c26f6337b1b05f2b51ca
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ public function setCause($cause)
*/
public function addViolation()
{
$paths = empty($this->propertyPaths) ? [$this->basePropertyPath] : $this->propertyPaths;

if (null === $this->plural) {
$translatedMessage = $this->translator->trans(
$this->message,
Expand All @@ -160,7 +162,7 @@ public function addViolation()
);
}

foreach ($this->propertyPaths as $propertyPath) {
foreach ($paths as $propertyPath) {
$this->violations->add(new ConstraintViolation(
$translatedMessage,
$this->message,
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.