The method isValid of ConstraintValidatorInterface was renamed to
validate and its return value was dropped.
ConstraintValidator still contains the deprecated isValid method and
forwards validate calls to isValid by default. This BC layer will be
removed in Symfony 2.3. You are advised to rename your methods. You should
also remove the return values, which have never been used by the framework.
Before:
public function isValid($value, Constraint $constraint)
{
// ...
if (!$valid) {
$this->context->addViolation($constraint->message, array(
'{{ value }}' => $value,
));
return false;
}
}
After:
public function validate($value, Constraint $constraint)
{
// ...
if (!$valid) {
$this->context->addViolation($constraint->message, array(
'{{ value }}' => $value,
));
return;
}
}
The method
isValid
ofConstraintValidatorInterface
was renamed tovalidate
and its return value was dropped.ConstraintValidator
still contains the deprecatedisValid
method and forwardsvalidate
calls toisValid
by default. This BC layer will be removed in Symfony 2.3. You are advised to rename your methods. You should also remove the return values, which have never been used by the framework.Before:
After: