| Total Complexity | 8 |
| Total Lines | 70 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 5 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 9 | final class Result |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var Error[] |
||
| 13 | */ |
||
| 14 | private array $errors = []; |
||
| 15 | |||
| 16 | 159 | public function isValid(): bool |
|
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @psalm-param list<int|string>|null $valuePath |
||
| 23 | */ |
||
| 24 | 129 | public function addError(string $message, ?array $valuePath = null): void |
|
| 25 | { |
||
| 26 | 129 | $this->errors[] = new Error($message, $valuePath); |
|
| 27 | 129 | } |
|
| 28 | |||
| 29 | /** |
||
| 30 | * @return Error[] |
||
| 31 | */ |
||
| 32 | 17 | public function getErrorObjects(): array |
|
| 33 | { |
||
| 34 | 17 | return $this->errors; |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @return string[] |
||
| 39 | */ |
||
| 40 | 34 | public function getErrors(): array |
|
| 45 | 34 | }); |
|
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return array |
||
| 50 | */ |
||
| 51 | 1 | public function getNestedDetailedErrors(): array |
|
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @return array |
||
| 70 | */ |
||
| 71 | 1 | public function getFlatDetailedErrors(): array |
|
| 81 |