[Validator] remove return value in TrueValidator

This commit is contained in:
Tobias Schultze 2012-07-19 23:47:59 +03:00
parent 67bf84d7c5
commit d85650d29f
1 changed files with 3 additions and 7 deletions

View File

@ -27,15 +27,11 @@ class TrueValidator extends ConstraintValidator
public function validate($value, Constraint $constraint)
{
if (null === $value) {
return true;
return;
}
if (true === $value || 1 === $value || '1' === $value) {
return true;
if (true !== $value && 1 !== $value && '1' !== $value) {
$this->context->addViolation($constraint->message);
}
$this->context->addViolation($constraint->message);
return false;
}
}