Total Complexity | 4 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
7 | final class Result |
||
8 | { |
||
9 | /** |
||
10 | * @var ErrorMessage[] |
||
11 | */ |
||
12 | private array $errors = []; |
||
13 | |||
14 | 137 | public function isValid(): bool |
|
17 | } |
||
18 | |||
19 | 120 | public function addError(ErrorMessage $error): void |
|
22 | 120 | } |
|
23 | |||
24 | /** |
||
25 | * @param ErrorMessageFormatterInterface|null $formatter |
||
26 | * |
||
27 | * @return ErrorMessage[] |
||
28 | */ |
||
29 | 18 | public function getRawErrors(): array |
|
30 | { |
||
31 | 18 | return $this->errors; |
|
32 | } |
||
33 | |||
34 | /** |
||
35 | * @param ErrorMessageFormatterInterface|null $formatter |
||
36 | * |
||
37 | * @return string[] |
||
38 | */ |
||
39 | 29 | public function getErrors(?ErrorMessageFormatterInterface $formatter = null): array |
|
46 | ); |
||
47 | } |
||
49 |