/** * {@inheritDoc} */ public function isOptionalEmail($value, $suppressException = true) { /* Clear the last error. */ $this->lastError = null; /* If valid just return true. */ if (Validator::isOptionalEmail($value)) { return true; } /* Set the error message. */ $this->lastError = sprintf('Expected null or email, \'%s\' given.', is_scalar($value) ? $value : gettype($value)); return $this->validationFailed($suppressException); }