| Total Complexity | 1 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | trait ClientHandler |
||
| 8 | { |
||
| 9 | public function clientException(ClientException $exception) |
||
| 10 | { |
||
| 11 | $requestHost = $exception->getRequest()->getUri()->getHost(); |
||
| 12 | |||
| 13 | $detail = __('exception::exceptions.client.unavailable'); |
||
| 14 | $code = $this->getCode('client.default'); |
||
| 15 | if ($this->clientExceptionCausers()::PAGARME_HOST == $requestHost) { |
||
| 16 | $detail = $detail; |
||
| 17 | $code = $this->getCode('client.pagarme'); |
||
| 18 | } |
||
| 19 | |||
| 20 | $error = [[ |
||
| 21 | 'status' => 500, |
||
| 22 | 'code' => $code, |
||
| 23 | 'source' => ['pointer' => $exception->getFile().':'.$exception->getLine()], |
||
| 24 | 'title' => 'client_exception', |
||
| 25 | 'detail' => $detail, |
||
| 26 | ]]; |
||
| 27 | |||
| 28 | $this->jsonApiResponse->setStatus(500); |
||
| 29 | $this->jsonApiResponse->setErrors($error); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function clientExceptionCausers() |
||
| 36 | }; |
||
| 37 | } |
||
| 38 | } |
||
| 39 |
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