| Total Complexity | 4 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 5 | class ValidationResult |
||
| 6 | { |
||
| 7 | private array $errors = []; |
||
| 8 | |||
| 9 | public function addError(array $path, $errorMessage): void |
||
| 10 | { |
||
| 11 | $this->errors[$this->getPath($path)] = $errorMessage; |
||
| 12 | } |
||
| 13 | |||
| 14 | public function isValid(): bool |
||
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @return array |
||
| 21 | */ |
||
| 22 | public function getErrors(): array |
||
| 23 | { |
||
| 24 | return $this->errors; |
||
| 25 | } |
||
| 26 | |||
| 27 | private function getPath(array $path): string |
||
| 30 | } |
||
| 31 | } |
||
| 32 |