| Total Complexity | 4 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 6 | class ValidationResult implements Result |
||
| 7 | { |
||
| 8 | /** @var string[] */ |
||
| 9 | private array $errors = []; |
||
| 10 | |||
| 11 | public static function everythingIsOk(): self |
||
| 12 | { |
||
| 13 | return new self; |
||
| 14 | } |
||
| 15 | |||
| 16 | public function error(string ...$errors): self |
||
| 17 | { |
||
| 18 | array_push($this->errors, ...$errors); |
||
| 19 | return $this; |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @inheritDoc |
||
| 24 | */ |
||
| 25 | public function isOk(): bool |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @inheritDoc |
||
| 32 | */ |
||
| 33 | public function getErrors(): array |
||
| 36 | } |
||
| 37 | } |
||
| 38 |