1 | <?php |
||
9 | class UIValidationCollectionException extends AbstractNormalizableCommandResolverException |
||
10 | { |
||
11 | /** @var UIValidationException[] */ |
||
12 | private $uiValidationExceptions = []; |
||
13 | |||
14 | /** |
||
15 | * @param UIValidationException[] $uiValidationExceptions |
||
16 | */ |
||
17 | public function __construct(array $uiValidationExceptions) |
||
30 | |||
31 | private function add(UIValidationException $uiValidationException) |
||
35 | |||
36 | /** |
||
37 | * @inheritdoc |
||
38 | * See http://jsonapi.org/examples/#error-objects-basics |
||
39 | * Example: |
||
40 | * { |
||
41 | * "errors": [ |
||
42 | * { |
||
43 | * "status": "403", |
||
44 | * "source": { "pointer": "/data/attributes/secret-powers" }, |
||
45 | * "detail": "Editing secret powers is not authorized on Sundays." |
||
46 | * }, |
||
47 | * { |
||
48 | * "source": { "parameter": "include" }, |
||
49 | * "title": "Invalid Query Parameter", |
||
50 | * "detail": "The resource does not have an `auther` relationship path." |
||
51 | * }, |
||
52 | * { |
||
53 | * "status": "422", |
||
54 | * "source": { "pointer": "/data/attributes/volume" }, |
||
55 | * "detail": "Volume does not, in fact, go to 11." |
||
56 | * }, |
||
57 | * { |
||
58 | * "status": "500", |
||
59 | * "source": { "pointer": "/data/attributes/reputation" }, |
||
60 | * "title": "The backend responded with an error", |
||
61 | * "detail": "Reputation service not responding after three requests." |
||
62 | * } |
||
63 | * ] |
||
64 | * } |
||
65 | */ |
||
66 | public function normalize(): array |
||
76 | |||
77 | /** |
||
78 | * @param UIValidationException[] $uiValidationExceptions |
||
79 | */ |
||
80 | private function guardAgainstNoUIValidationException(array $uiValidationExceptions) |
||
86 | } |
||
87 |