| Conditions | 2 |
| Paths | 5 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function fetchAction(Request $request) |
||
| 29 | { |
||
| 30 | try { |
||
| 31 | $postcode = $request->get('postcode'); |
||
| 32 | $houseNumber = $request->get('nummer'); |
||
| 33 | |||
| 34 | $address = $this->get('usoft.postcode.client')->getAddress($postcode, $houseNumber); |
||
| 35 | |||
| 36 | return new JsonResponse($address->toArray()); |
||
| 37 | } catch (\Exception $exception) { |
||
| 38 | return new JsonResponse(['message' => $exception->getMessage()], Response::HTTP_SERVICE_UNAVAILABLE); |
||
| 39 | } |
||
| 40 | } |
||
| 41 | } |
||
| 42 |