@@ -27,9 +27,9 @@ |
||
27 | 27 | */ |
28 | 28 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
29 | 29 | { |
30 | - if ($this->isJsonPayload($request)) { |
|
30 | + if ($this->isJsonPayload($request)){ |
|
31 | 31 | $request = $request->withParsedBody(json_decode($request->getBody()->getContents(), true)); |
32 | - if (json_last_error() !== 0) { |
|
32 | + if (json_last_error() !== 0){ |
|
33 | 33 | throw new ClientException(400, 'invalid json payload'); |
34 | 34 | } |
35 | 35 | } |
@@ -27,9 +27,11 @@ |
||
27 | 27 | */ |
28 | 28 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
29 | 29 | { |
30 | - if ($this->isJsonPayload($request)) { |
|
30 | + if ($this->isJsonPayload($request)) |
|
31 | + { |
|
31 | 32 | $request = $request->withParsedBody(json_decode($request->getBody()->getContents(), true)); |
32 | - if (json_last_error() !== 0) { |
|
33 | + if (json_last_error() !== 0) |
|
34 | + { |
|
33 | 35 | throw new ClientException(400, 'invalid json payload'); |
34 | 36 | } |
35 | 37 | } |