Last Updated: February 25, 2016
·
488
· gxela

Symfony 2.0 to 2.3 update, validator validate

...Validator contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Symfony\Component\Validator\ConstraintValidatorInterface::validate) in ...

add wrapper(for backwards compatibility with existing forms and tests):

public function validate($value, Constraint $constraint)
{
    return $this->isValid($value, $constraint);
}

or change:

public function isValid($value, Constraint $constraint)
{
...

to:

public function validate($value, Constraint $constraint)
{
...

and in all your code change, isValid() to validate(), which will make your code faster by an immeasurable amount