| Total Complexity | 4 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 12 | use Alive2212\LaravelSmartResponse\ResponseModel; |
||
| 13 | |||
| 14 | class SmartResponse |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @param ResponseModel $response |
||
| 18 | * @return \Illuminate\Http\JsonResponse |
||
|
|
|||
| 19 | */ |
||
| 20 | public static function response(ResponseModel $response) |
||
| 21 | { |
||
| 22 | $header = array( |
||
| 23 | 'Content-Type' => 'application/json; charset=UTF-8', |
||
| 24 | 'charset' => 'utf-8' |
||
| 25 | ); |
||
| 26 | if (!is_null($response->getError())) { |
||
| 27 | return response()->json([ |
||
| 28 | 'status' => $response->getStatus(), |
||
| 29 | 'data' => $response->getData()->count() ? $response->getData() : null, |
||
| 30 | 'message' => $response->getMessage(), |
||
| 31 | 'error_code' => $response->getError(), |
||
| 32 | ], $response->getstatusCode(), $header, JSON_UNESCAPED_UNICODE); |
||
| 33 | } else { |
||
| 34 | return response()->json([ |
||
| 35 | 'status' => $response->getStatus(), |
||
| 36 | 'data' => $response->getData()->count() ? $response->getData() : null, |
||
| 37 | 'message' => $response->getMessage(), |
||
| 43 |
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