Total Complexity | 2 |
Total Lines | 21 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | class JsonApiException extends Exception implements Responsable |
||
17 | { |
||
18 | /** |
||
19 | * @var JsonApiErrorData[] $errors |
||
20 | */ |
||
21 | public readonly array $errors; |
||
22 | |||
23 | /** |
||
24 | * Instantiate the class. |
||
25 | */ |
||
26 | 1 | public function __construct(JsonApiErrorData ...$errors) |
|
27 | { |
||
28 | 1 | $this->errors = $errors; |
|
|
|||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Render the JSON:API errors. |
||
33 | */ |
||
34 | 1 | public function toResponse($request): Response |
|
37 | } |
||
38 | } |
||
39 |