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
Written by Alex Goretoy
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Symfony
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#