Skip to content

Commit 719d1bf

Browse files
authored
Fixed accessing non-interface methods in StructWrapperValidator (#750)
For more details see #750 Key changes: * Fixed accessing non-interface methods in StructWrapperValidator
1 parent 7f5ba21 commit 719d1bf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/contracts/Validation/StructWrapperValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ public function validate($value, $constraints = null, $groups = null): Constrain
6262
$error->getInvalidValue(),
6363
$error->getPlural(),
6464
$error->getCode(),
65-
$error->getConstraint(),
66-
$error->getCause()
65+
$error instanceof ConstraintViolation ? $error->getConstraint() : null,
66+
$error instanceof ConstraintViolation ? $error->getCause() : null
6767
);
6868

6969
$unwrappedErrors->add($unwrappedError);

0 commit comments

Comments
 (0)