Total Complexity | 8 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 4 | ||
Bugs | 2 | Features | 0 |
1 | <?php |
||
9 | final class RequestValidationException extends RuntimeException |
||
10 | { |
||
11 | private const MESSAGE = 'Request model validation error'; |
||
12 | |||
13 | /** |
||
14 | * @param string[] $errors |
||
15 | * |
||
16 | * @psalm-param array<string,string[]> $errors |
||
17 | */ |
||
18 | 5 | public function __construct( |
|
19 | private array $errors |
||
20 | ) { |
||
21 | 5 | parent::__construct(self::MESSAGE); |
|
22 | } |
||
23 | |||
24 | /** |
||
25 | * @psalm-return array<string,string[]> |
||
26 | */ |
||
27 | 1 | public function getErrors(): array |
|
28 | { |
||
29 | 1 | return $this->errors; |
|
30 | } |
||
31 | |||
32 | /** |
||
33 | * @psalm-return array<string,string> |
||
34 | */ |
||
35 | 3 | public function getFirstErrors(): array |
|
49 | } |
||
50 | |||
51 | 2 | public function getFirstError(): ?string |
|
58 |