| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0175 |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | 11 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
| 20 | { |
||
| 21 | 11 | $data = $request->getParsedBody(); |
|
| 22 | 11 | if (!is_array($data)) { |
|
| 23 | return (new DataValidationResponseFactory())(); |
||
| 24 | } |
||
| 25 | |||
| 26 | 11 | $user = $request->getAttribute(TokenMiddleware::USER_PARAM); |
|
| 27 | 11 | if ($user) { |
|
| 28 | 11 | $data[ClaimedResourceInterface::OWNER_PARAM] = $user; |
|
| 29 | } |
||
| 30 | |||
| 31 | 11 | return $handler->handle($request->withParsedBody($data)); |
|
| 32 | } |
||
| 33 | } |
||
| 34 |