public function setError(?string $message = null) : void
    {
        $this->is_valid = false;
        $this->error = (null === $message) ? $this->default_error : $message;
    }
public function setError(?string $message = null) : void
    {
        $this->is_valid = false;
        $this->error = (null === $message) ? $this->default_error : $message;
    }
public function setError ( ? string $ message = null ) : void { $ this -> is_valid = false ; $ this -> error = ( null === $ message ) ? $ this -> default_error : $ message ; }
Allows other systems such as the form's validator, to set this element as invalid. If no error message is
specified, the default error message will be set.
@param string|null $message
Allows other systems such as the form s validator to set this element as invalid . If no error message is specified the default error message will be set .