Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | public function createResponse(ApiProblem $apiProblem) |
||
23 | { |
||
24 | $data = $apiProblem->toArray(); |
||
25 | if ('about:blank' != $data['type']) { |
||
26 | $data['type'] = 'http://localhost/just_url/web/errors#'.$data['type']; |
||
27 | } |
||
28 | $response = new JsonResponse($data, $apiProblem->getStatusCode()); |
||
29 | $response->headers->set('Content-Type', 'application/problem+json'); |
||
30 | |||
31 | return $response; |
||
32 | } |
||
34 |