| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | 31 | public function deleteMethod(Request $request, string $id, ?array $allowedHttpMethods = null): Response |
|
| 31 | { |
||
| 32 | 31 | $resource = $this->getResourceForMethod($request, $allowedHttpMethods ?? [Request::METHOD_DELETE]); |
|
|
|
|||
| 33 | |||
| 34 | try { |
||
| 35 | // Fetch data from database |
||
| 36 | 22 | return $this |
|
| 37 | 22 | ->getResponseHandler() |
|
| 38 | 22 | ->createResponse($request, $resource->delete($id), $resource); |
|
| 39 | 7 | } catch (Throwable $exception) { |
|
| 40 | 7 | throw $this->handleRestMethodException($exception, $id); |
|
| 41 | } |
||
| 44 |