| Total Complexity | 8 | 
| Total Lines | 43 | 
| Duplicated Lines | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 10 | final class ApiResponseDataFactory | ||
| 11 | { | ||
| 12 | public function createFromResponse(DataResponse $response): ApiResponse | ||
| 13 |     { | ||
| 14 |         if ($response->getStatusCode() !== Status::OK) { | ||
| 15 | return $this | ||
| 16 | ->createErrorResponse() | ||
| 17 | ->setErrorCode($response->getStatusCode()) | ||
| 18 | ->setErrorMessage($this->getErrorMessage($response)); | ||
| 19 | } | ||
| 20 | |||
| 21 | return $this | ||
| 22 | ->createSuccessResponse() | ||
| 23 | ->setData($response->getData()); | ||
| 24 | } | ||
| 25 | |||
| 26 | public function createSuccessResponse(): ApiResponse | ||
| 31 | } | ||
| 32 | |||
| 33 | public function createErrorResponse(): ApiResponse | ||
| 34 |     { | ||
| 35 | return $this | ||
| 36 | ->createResponse() | ||
| 37 |             ->setStatus('failed'); | ||
| 38 | } | ||
| 39 | |||
| 40 | public function createResponse(): ApiResponse | ||
| 43 | } | ||
| 44 | |||
| 45 | private function getErrorMessage(DataResponse $response): string | ||
| 53 | } | ||
| 54 | } | ||
| 55 | 
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