Total Complexity | 1 |
Total Lines | 15 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
21 | { |
||
22 | /** |
||
23 | * Echoes the request back out to the response |
||
24 | * @param ServerRequestInterface $request |
||
25 | * @param RequestHandlerInterface $handler |
||
26 | * @return ResponseInterface |
||
27 | */ |
||
28 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
||
29 | { |
||
30 | $stream = fopen('php://memory', 'r+'); |
||
31 | fwrite($stream, $request->getAttribute('ncryptf-decrypted-body')); |
||
32 | rewind($stream); |
||
33 | return Factory::createResponse() |
||
34 | ->withBody(new \Zend\Diactoros\Stream($stream)); |
||
35 | } |
||
36 | } |
||
37 |