symfony/symfony — Issue #3269: [Validator] [BCBreak] Deprecated ConstraintValidator methods setMessage(),
Author: Maks3w
Created: 2012-02-04 22:19:24+00:00
State: open

Since https://github.com/symfony/symfony/commit/9153f0e5691e67e343222b44f30034828680536c customs Validator are broken and not only deprecated

````
public function isValid($value, Constraint $constraint)
{
//...
$this->setMessage($constraint->message, array(
'%property%' => $constraint->property
));
//...
}
````

(https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Validator/UniqueValidator.php)

throws this error

````
PHP Fatal error: Call to a member function addViolation() on a non-object in /Users/***Bundle/vendor/symfony/src/Symfony/Component/Validator/ConstraintValidator.php on line 82
````