EmailValidation.php 751 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace Egulias\EmailValidator\Validation;
  3. use Egulias\EmailValidator\EmailLexer;
  4. use Egulias\EmailValidator\Exception\InvalidEmail;
  5. use Egulias\EmailValidator\Warning\Warning;
  6. interface EmailValidation
  7. {
  8. /**
  9. * Returns true if the given email is valid.
  10. *
  11. * @param string $email The email you want to validate.
  12. * @param EmailLexer $emailLexer The email lexer.
  13. *
  14. * @return bool
  15. */
  16. public function isValid($email, EmailLexer $emailLexer);
  17. /**
  18. * Returns the validation error.
  19. *
  20. * @return InvalidEmail|null
  21. */
  22. public function getError();
  23. /**
  24. * Returns the validation warnings.
  25. *
  26. * @return Warning[]
  27. */
  28. public function getWarnings();
  29. }