src/Fields/SimpleSpamGuardField.php
public function validate($validator)
    {
        // Check Value and Timestamp:
        
        if (!empty($this->value) || $this->tooSoon()) {
            
            // Define Validation Error:
            
            $validator->validationError(
                $this->name,
                _t(
                    __CLASS__ . '.VALIDATIONERROR',
                    'Sorry, an error has occurred. Please try again later.'
                ),
                'validation'
            );
            
            // Answer Failure:
            
            return false;
            
        }
        
        // Answer Success:
        
        return true;
    }
public function validate($validator)
    {
        // Check Value and Timestamp:
        
        if (!empty($this->value) || $this->tooSoon()) {
            
            // Define Validation Error:
            
            $validator->validationError(
                $this->name,
                _t(
                    __CLASS__ . '.VALIDATIONERROR',
                    'Sorry, an error has occurred. Please try again later.'
                ),
                'validation'
            );
            
            // Answer Failure:
            
            return false;
            
        }
        
        // Answer Success:
        
        return true;
    }
public function validate ( $ validator ) { // Check Value and Timestamp: if ( ! empty ( $ this -> value ) || $ this -> tooSoon ( ) ) { // Define Validation Error: $ validator -> validationError ( $ this -> name , _t ( __CLASS__ . '.VALIDATIONERROR' , 'Sorry, an error has occurred. Please try again later.' ) , 'validation' ) ; // Answer Failure: return false ; } // Answer Success: return true ; }
Answers true if the value is valid for the receiver.

@param Validator $validator

@return boolean
Answers true if the value is valid for the receiver .