@author Bernhard Schussek <bschussek@gmail.com>
@api
Expanded class hierarchy of FalseValidator
class FalseValidator extends ConstraintValidator {
/**
* {@inheritDoc}
*/
public function validate($value, Constraint $constraint) {
if (null === $value || false === $value || 0 === $value || '0' === $value) {
return;
}
$this->context
->addViolation($constraint->message);
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConstraintValidator:: |
protected | property | ||
ConstraintValidator:: |
public | function |
Initializes the constraint validator. Overrides ConstraintValidatorInterface:: |
1 |
FalseValidator:: |
public | function |
Checks if the passed value is valid. Overrides ConstraintValidatorInterface:: |