Validator/SpamValidator.php
/**
     * Indicates whether the constraint is valid.
     *
     * @param object|NewThreadMessage     $value
     * @param Constraint $constraint
     */
Indicates whether the constraint is valid.
@param object|NewThreadMessage     $value
@param Constraint $constraint
Indicates whether the constraint is valid . @param object|NewThreadMessage $value @param Constraint $constraint
public function validate($value, Constraint $constraint)
    {
        if ($this->spamDetector->isSpam($value)) {
            $this->getContext()->addViolation($constraint->message);
        }
    }
public function validate ( $ value , Constraint $ constraint ) { if ( $ this -> spamDetector -> isSpam ( $ value ) ) { $ this -> getContext ( ) -> addViolation ( $ constraint -> message ) ; } }
Indicates whether the constraint is valid.
Indicates whether the constraint is valid .