1 | <?php |
||
2 | |||
3 | namespace NovaNavigaAdPreview\Http\Controllers; |
||
4 | |||
5 | use Illuminate\Http\Request; |
||
6 | use Illuminate\Support\Facades\Response; |
||
7 | use Illuminate\Support\Str; |
||
8 | use NavigaAdClient\NavigaAd; |
||
9 | use NavigaAdClient\Responses\PaginatedResponse; |
||
0 ignored issues
–
show
|
|||
10 | |||
11 | class DirectRequestController extends Controller |
||
12 | { |
||
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 | ]); |
|
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