Нет описания

SubscriberError.php 698B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace MailPoet\Mailer;
  3. if (!defined('ABSPATH')) exit;
  4. class SubscriberError {
  5. /** @var string */
  6. private $email;
  7. /** @var string|null */
  8. private $message;
  9. /**
  10. * @param string $email
  11. * @param string $message|null
  12. */
  13. public function __construct(
  14. $email,
  15. $message = null
  16. ) {
  17. $this->email = $email;
  18. $this->message = $message;
  19. }
  20. /**
  21. * @return string
  22. */
  23. public function getEmail() {
  24. return $this->email;
  25. }
  26. /**
  27. * @return null|string
  28. */
  29. public function getMessage() {
  30. return $this->message;
  31. }
  32. public function __toString() {
  33. return $this->message ? $this->email . ': ' . $this->message : $this->email;
  34. }
  35. }