| Total Complexity | 2 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | class ValidatorException extends BaseValidatorException implements ClientErrorInterface |
||
| 28 | { |
||
| 29 | /** |
||
| 30 | * @throws JsonException |
||
| 31 | */ |
||
| 32 | 25 | public function __construct(string $target, ConstraintViolationListInterface $errors) |
|
| 33 | { |
||
| 34 | 25 | parent::__construct( |
|
| 35 | 25 | JSON::encode( |
|
| 36 | 25 | array_map( |
|
| 37 | 25 | static fn (ConstraintViolationInterface $error): ValidatorError => |
|
| 38 | 25 | new ValidatorError($error, $target), |
|
| 39 | 25 | iterator_to_array($errors), |
|
| 40 | 25 | ), |
|
| 41 | 25 | ), |
|
| 42 | 25 | ); |
|
| 43 | } |
||
| 44 | |||
| 45 | 4 | public function getStatusCode(): int |
|
| 48 | } |
||
| 49 | } |
||
| 50 |