Conditions | 4 |
Paths | 3 |
Total Lines | 23 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 16 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | 1 | public function __invoke(Request $request) |
|
14 | { |
||
15 | 1 | $request->validate([ |
|
16 | 1 | 'endpoint' => ['required', 'string'], |
|
17 | 1 | 'query' => ['nullable', 'string'], |
|
18 | 1 | ]); |
|
19 | |||
20 | 1 | $endpoint = $request->input('endpoint'); |
|
21 | 1 | $query = array_filter(array_map('trim', explode(PHP_EOL, $request->input('query', '')))); |
|
22 | 1 | $queryData = []; |
|
23 | 1 | foreach ($query as $line) { |
|
24 | 1 | $key = Str::before($line, ':'); |
|
25 | 1 | $value = Str::after($line, ':'); |
|
26 | 1 | if ($key && $value) { |
|
27 | 1 | $queryData[$key] = $value; |
|
28 | } |
||
29 | } |
||
30 | |||
31 | /** @var PaginatedResponse $response */ |
||
32 | 1 | $response = NavigaAd::pendingRequest()->get($endpoint, $queryData); |
|
33 | |||
34 | 1 | return Response::json([ |
|
35 | 1 | 'data' => $response->json(), |
|
36 | 1 | ]); |
|
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