[Validator][callback constraint] include class name in ConstraintDefinitionException.

This commit is contained in:
Abdellatif Ait boudad 2015-06-10 14:31:20 +00:00 committed by Fabien Potencier
parent f5d5a3be96
commit 51212acbff

View File

@ -60,7 +60,7 @@ class CallbackValidator extends ConstraintValidator
call_user_func($method, $object, $this->context);
} elseif (null !== $object) {
if (!method_exists($object, $method)) {
throw new ConstraintDefinitionException(sprintf('Method "%s" targeted by Callback constraint does not exist', $method));
throw new ConstraintDefinitionException(sprintf('Method "%s" targeted by Callback constraint does not exist in class %s', $method, get_class($object)));
}
$reflMethod = new \ReflectionMethod($object, $method);