MultipleErrors.php 606 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Egulias\EmailValidator\Validation;
  3. use Egulias\EmailValidator\Exception\InvalidEmail;
  4. class MultipleErrors extends InvalidEmail
  5. {
  6. const CODE = 999;
  7. const REASON = "Accumulated errors for multiple validations";
  8. /**
  9. * @var InvalidEmail[]
  10. */
  11. private $errors = [];
  12. /**
  13. * @param InvalidEmail[] $errors
  14. */
  15. public function __construct(array $errors)
  16. {
  17. $this->errors = $errors;
  18. parent::__construct();
  19. }
  20. /**
  21. * @return InvalidEmail[]
  22. */
  23. public function getErrors()
  24. {
  25. return $this->errors;
  26. }
  27. }