Skip to content

Commit 205f9eb

Browse files
author
omasn
committed
Fix ViolationFactory path
1 parent c2f5fce commit 205f9eb

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/ViolationFactory.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,17 @@ public function fromViolationParent(
4040
ConstraintViolationInterface $violation,
4141
string $parentPropertyPath
4242
): ConstraintViolationInterface {
43+
$propertyPath = $parentPropertyPath;
44+
if ('' !== trim($violation->getPropertyPath())) {
45+
$propertyPath .= $violation->getPropertyPath();
46+
}
47+
4348
return new ConstraintViolation(
4449
$violation->getMessage(),
4550
$violation->getMessageTemplate(),
4651
$violation->getParameters(),
4752
$violation->getRoot(),
48-
$parentPropertyPath . '.' . $violation->getPropertyPath(),
53+
$propertyPath,
4954
$violation->getInvalidValue()
5055
);
5156
}

0 commit comments

Comments
 (0)