| Conditions | 3 |
| Paths | 3 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3.0416 |
| Changes | 0 | ||
| 1 | <?php |
||
| 55 | 3 | private function getContents($request): string |
|
| 56 | { |
||
| 57 | 3 | if ($request instanceof RequestInterface) { |
|
| 58 | 2 | return $request->getBody()->getContents(); |
|
| 59 | } |
||
| 60 | 1 | if (\is_string($request)) { |
|
| 61 | 1 | return $request; |
|
| 62 | } |
||
| 63 | throw new BadRequestException('Request must be instance of Psr\Http\Message\RequestInterface or string.'); |
||
| 64 | } |
||
| 66 |