| Conditions | 3 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function render($request, Exception $e): Response |
||
| 33 | { |
||
| 34 | $dataProvider = new ApiExceptionDataProvider(); |
||
| 35 | $dataProvider->setStatus($e->getCode()) |
||
| 36 | ->setException(get_class($e)) |
||
| 37 | ->setMessage($e->getMessage()); |
||
| 38 | |||
| 39 | if ($this->getFacade()->isDebug()) { |
||
| 40 | $dataProvider->setTrace($e->getTraceAsString()); |
||
| 41 | } |
||
| 42 | |||
| 43 | $response = new JsonResponse(); |
||
| 44 | if (method_exists($e, 'getStatusCode')) { |
||
| 45 | $response->setStatusCode($e->getStatusCode()); |
||
| 46 | } else { |
||
| 47 | $response->setStatusCode(500); |
||
| 48 | } |
||
| 49 | |||
| 50 | $response->setData($dataProvider->toArray()); |
||
| 51 | |||
| 52 | return $response; |
||
| 53 | } |
||
| 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