Conditions | 1 |
Paths | 1 |
Total Lines | 6 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
30 | 2 | public static function parseBodyAsJSON(ServerRequestInterface $serverRequest): ServerRequestInterface |
|
31 | { |
||
32 | //Use toString so that we don't have to rewind it |
||
33 | 2 | $jsonBody = json_decode($serverRequest->getBody()->__toString(), true); |
|
34 | 2 | return $serverRequest->withParsedBody($jsonBody); |
|
35 | } |
||
36 | } |
||
37 |