[Validator] remove return value in TrueValidator
This commit is contained in:
parent
67bf84d7c5
commit
d85650d29f
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Reference in New Issue