1 | <?php |
||||
2 | |||||
3 | namespace SMartins\JsonHandler; |
||||
4 | |||||
5 | use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; |
||||
0 ignored issues
–
show
|
|||||
6 | |||||
7 | trait BadRequestHttpHandler |
||||
8 | { |
||||
9 | public function badRequestHttpException(BadRequestHttpException $exception) |
||||
10 | { |
||||
11 | $statusCode = $exception->getStatusCode(); |
||||
12 | |||||
13 | $error = [[ |
||||
14 | 'status' => $statusCode, |
||||
15 | 'code' => $this->getCode('bad_request'), |
||||
0 ignored issues
–
show
It seems like
getCode() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
16 | 'source' => ['pointer' => $exception->getFile().':'.$exception->getLine()], |
||||
17 | 'title' => 'bad_request', |
||||
18 | 'detail' => $exception->getMessage(), |
||||
19 | ]]; |
||||
20 | |||||
21 | $this->jsonApiResponse->setStatus($statusCode); |
||||
0 ignored issues
–
show
|
|||||
22 | $this->jsonApiResponse->setErrors($error); |
||||
23 | } |
||||
24 | } |
||||
25 |
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