Skip to content

Commit 80473d8

Browse files
Fix failing tests after merge
1 parent a3c8a27 commit 80473d8

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

src/Symfony/Component/Validator/Constraints/CallbackValidator.php

+10-16
Original file line numberDiff line numberDiff line change
@@ -58,24 +58,18 @@ public function validate($object, Constraint $constraint)
5858
}
5959

6060
call_user_func($method, $object, $this->context);
61+
} elseif (null !== $object) {
62+
if (!method_exists($object, $method)) {
63+
throw new ConstraintDefinitionException(sprintf('Method "%s" targeted by Callback constraint does not exist', $method));
64+
}
6165

62-
continue;
63-
}
64-
65-
if (null === $object) {
66-
continue;
67-
}
68-
69-
if (!method_exists($object, $method)) {
70-
throw new ConstraintDefinitionException(sprintf('Method "%s" targeted by Callback constraint does not exist', $method));
71-
}
72-
73-
$reflMethod = new \ReflectionMethod($object, $method);
66+
$reflMethod = new \ReflectionMethod($object, $method);
7467

75-
if ($reflMethod->isStatic()) {
76-
$reflMethod->invoke(null, $object, $this->context);
77-
} else {
78-
$reflMethod->invoke($object, $this->context);
68+
if ($reflMethod->isStatic()) {
69+
$reflMethod->invoke(null, $object, $this->context);
70+
} else {
71+
$reflMethod->invoke($object, $this->context);
72+
}
7973
}
8074
}
8175
}

0 commit comments

Comments
 (0)