| Total Complexity | 6 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | final class Result |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var Error[] |
||
| 13 | */ |
||
| 14 | private array $errors = []; |
||
| 15 | |||
| 16 | 169 | public function isValid(): bool |
|
| 17 | { |
||
| 18 | 169 | return $this->errors === []; |
|
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @return Error[] |
||
| 23 | */ |
||
| 24 | 24 | public function getErrorObjects(): array |
|
| 25 | { |
||
| 26 | 24 | return $this->errors; |
|
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @return string[] |
||
| 31 | */ |
||
| 32 | 38 | public function getErrors(): array |
|
| 35 | } |
||
| 36 | |||
| 37 | 4 | public function getErrorsIndexedByPath(string $separator = '.'): array |
|
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @psalm-param array<int|string> $valuePath |
||
| 50 | */ |
||
| 51 | 144 | public function addError(string $message, array $valuePath = []): void |
|
| 56 |