| Conditions | 3 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 20 | public static function getStorageKey(RequestInterface $request) : string |
|
| 33 | { |
||
| 34 | 20 | $method = $request->getMethod(); |
|
| 35 | 20 | if ($method !== 'GET') |
|
| 36 | { |
||
| 37 | 3 | $contentType = $request->getHeader('Content-Type')[0] ?? null; |
|
| 38 | 3 | $params = $request->getBody()->getContents(); |
|
| 39 | |||
| 40 | 3 | return self::_getMethodAndParams( |
|
| 41 | 3 | $method, |
|
| 42 | 3 | $contentType === 'application/json' ? self::_decodeJSON($params) : $params |
|
| 43 | ); |
||
| 44 | } |
||
| 45 | |||
| 46 | 17 | return self::_getMethodAndParams($method, $request->getUri()->getQuery()); |
|
| 47 | } |
||
| 79 | } |