Lines
100.00%
3 / 3
Methods
100.00%
2 / 2
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| withErrors | 100.00% | 2 / 2 | 100.00% | 1 / 1 | 1 | ||
| getErrors | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| 9 | final class ValidationException extends RuntimeException | |
| 10 | { | |
| 11 | /** | |
| 12 | * @var string[] | |
| 13 | */ | |
| 14 | private array $errors = []; | |
| 15 | ||
| 16 | /** | |
| 17 | * @param string[] $errors | |
| 18 | */ | |
| 19 | public function withErrors(array $errors): self | |
| 20 | { | |
| 21 | $this->errors = $errors; | |
| 22 | return $this; | |
| 23 | } | |
| 24 | ||
| 25 | /** | |
| 26 | * @return string[] | |
| 27 | */ | |
| 28 | public function getErrors(): array | |
| 29 | { | |
| 30 | return $this->errors; | |
| 31 | } | |
| 32 | } |