Conditions | 2 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
31 | 29 | public function patchMethod( |
|
32 | Request $request, |
||
33 | RestDtoInterface $restDto, |
||
34 | string $id, |
||
35 | ?array $allowedHttpMethods = null, |
||
36 | ): Response { |
||
37 | 29 | $resource = $this->getResourceForMethod($request, $allowedHttpMethods ?? [Request::METHOD_PATCH]); |
|
|
|||
38 | |||
39 | try { |
||
40 | 20 | $data = $resource->patch($id, $restDto, true); |
|
41 | |||
42 | 13 | return $this->getResponseHandler()->createResponse($request, $data, $resource); |
|
43 | 7 | } catch (Throwable $exception) { |
|
44 | 7 | throw $this->handleRestMethodException($exception, $id); |
|
45 | } |
||
48 |