| Conditions | 5 |
| Paths | 3 |
| Total Lines | 24 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 5.5069 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | 587 | public static function fromGlobals( |
|
| 31 | array $server = null, |
||
| 32 | array $query = null, |
||
| 33 | array $body = null, |
||
| 34 | array $cookies = null, |
||
| 35 | array $files = null |
||
| 36 | ): ServerRequest { |
||
| 37 | |||
| 38 | 587 | $request = parent::fromGlobals($server, $query, $body, $cookies, $files); |
|
| 39 | |||
| 40 | 587 | $contentType = current($request->getHeader('Content-Type')); |
|
| 41 | |||
| 42 | // support header like "application/json" and "application/json; charset=utf-8" |
||
| 43 | 587 | if (false !== $contentType && false !== stripos($contentType, Request::TYPE_JSON)) { |
|
| 44 | $input = file_get_contents('php://input'); |
||
| 45 | $data = (array) json_decode($input, false); |
||
| 46 | 587 | } elseif ($request->getMethod() === RequestMethod::POST) { |
|
| 47 | $data = $_POST; |
||
| 48 | } else { |
||
| 49 | 587 | $input = file_get_contents('php://input'); |
|
| 50 | 587 | parse_str($input, $data); |
|
| 51 | } |
||
| 52 | |||
| 53 | 587 | return $request->withParsedBody($body ?: $data); |
|
| 54 | } |
||
| 56 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths