valid = (bool) $valid; $this->message = $message; $this->exception = $exception; } /** * Returns error message when an error occurs * @return string */ public function getMessage() { return $this->message; } /** * Tells if the MailService that produced this result was properly sent * @return bool */ public function isValid() { return $this->valid; } /** * Tells if this Result has an exception. Usually only non-valid result should wrap an exception * @return bool */ public function hasException() { return $this->exception instanceof Exception; } /** * Returns the exception wraped by this Result * @return \Exception */ public function getException() { return $this->exception; } /** * @return bool * @deprecated This method will be removed in the future. Use isValid() instead */ public function getResult() { return $this->isValid(); } }