| 1 | <?php |
||
| 7 | class ValidationResult implements \IteratorAggregate, \Countable |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var ValidationViolation[] |
||
| 11 | */ |
||
| 12 | protected $errors = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @param ValidationViolation $validationViolation |
||
| 16 | * |
||
| 17 | * @return ValidationResult |
||
| 18 | */ |
||
| 19 | 3 | public function addViolation(ValidationViolation $validationViolation): self |
|
| 25 | |||
| 26 | /** |
||
| 27 | * @return bool |
||
| 28 | */ |
||
| 29 | 5 | public function isValid(): bool |
|
| 33 | |||
| 34 | /** |
||
| 35 | * @return ValidationViolation[] |
||
| 36 | */ |
||
| 37 | 1 | public function getViolations(): array |
|
| 41 | |||
| 42 | /** |
||
| 43 | * {@inheritdoc} |
||
| 44 | * |
||
| 45 | * @return \ArrayIterator|ValidationViolation[] |
||
| 46 | */ |
||
| 47 | 1 | public function getIterator(): \ArrayIterator |
|
| 51 | |||
| 52 | /** |
||
| 53 | * {@inheritdoc. |
||
| 54 | */ |
||
| 55 | 1 | public function count(): int |
|
| 59 | } |
||
| 60 |