| 1 | <?php |
||
| 9 | class MultipleValidationWithAnd implements EmailValidation |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var EmailValidation[] |
||
| 13 | */ |
||
| 14 | private $validations = []; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var array |
||
| 18 | */ |
||
| 19 | private $warnings = []; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var InvalidEmail |
||
| 23 | */ |
||
| 24 | private $error; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var bool |
||
| 28 | */ |
||
| 29 | private $breakIfError; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param EmailValidation[] $validations The validations. |
||
| 33 | * @param bool $breakIfError If true, it breaks out of validation loop when error occurs, |
||
| 34 | * it means returned MultipleErrors might not contain all causes of errors. (false by default) |
||
| 35 | */ |
||
| 36 | 6 | public function __construct(array $validations, $breakIfError = false) |
|
| 45 | |||
| 46 | /** |
||
| 47 | * {@inheritdoc} |
||
| 48 | */ |
||
| 49 | 5 | public function isValid($email, EmailLexer $emailLexer) |
|
| 67 | |||
| 68 | /** |
||
| 69 | * {@inheritdoc} |
||
| 70 | */ |
||
| 71 | 3 | public function getError() |
|
| 75 | |||
| 76 | /** |
||
| 77 | * {@inheritdoc} |
||
| 78 | */ |
||
| 79 | 2 | public function getWarnings() |
|
| 83 | } |
||
| 84 |