EmailValidation.php 751 B

1234567891011121314151617181920212223242526272829303132333435
  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. }