| Conditions | 5 |
| Paths | 5 |
| Total Lines | 24 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 58 | private static function getRawInputs(): array |
||
| 59 | { |
||
| 60 | $inputParams = []; |
||
| 61 | |||
| 62 | if (in_array(self::$__method, ['PUT', 'PATCH', 'DELETE'])) { |
||
| 63 | |||
| 64 | $input = file_get_contents('php://input'); |
||
| 65 | |||
| 66 | if (self::$server->contentType()) { |
||
| 67 | switch (self::$server->contentType()) { |
||
| 68 | case 'application/x-www-form-urlencoded': |
||
| 69 | parse_str($input, $inputParams); |
||
| 70 | break; |
||
| 71 | case 'application/json': |
||
| 72 | $inputParams = json_decode($input); |
||
| 73 | break; |
||
| 74 | default : |
||
| 75 | $inputParams = parse_raw_http_request($input); |
||
| 76 | break; |
||
| 77 | } |
||
| 78 | } |
||
| 79 | } |
||
| 80 | |||
| 81 | return (array)$inputParams; |
||
| 82 | } |
||
| 84 | } |