Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
28 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
||
29 | { |
||
30 | if ($this->isJsonPayload($request)) { |
||
31 | try { |
||
32 | $request = $request->withParsedBody(json_decode($request->getBody()->getContents(), true)); |
||
33 | } catch (\Throwable $exception) { |
||
34 | throw new ClientException(400, 'invalid json payload'); |
||
35 | } |
||
36 | } |
||
37 | |||
38 | return $handler->handle($request); |
||
39 | } |
||
51 | } |