1 | <?php |
||||||
2 | |||||||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||||||
3 | namespace Hhxsv5\LaravelS\Components\Prometheus; |
||||||
4 | |||||||
5 | use Closure; |
||||||
6 | use Hhxsv5\LaravelS\Components\Prometheus\Collectors\HttpRequestCollector; |
||||||
7 | |||||||
8 | class RequestMiddleware |
||||||
0 ignored issues
–
show
|
|||||||
9 | { |
||||||
10 | private $collector; |
||||||
0 ignored issues
–
show
|
|||||||
11 | |||||||
12 | public function __construct(HttpRequestCollector $collector) |
||||||
0 ignored issues
–
show
|
|||||||
13 | { |
||||||
14 | $this->collector = $collector; |
||||||
15 | } |
||||||
16 | |||||||
17 | /** |
||||||
18 | * Handle an incoming request. |
||||||
19 | * |
||||||
20 | * @param \Illuminate\Http\Request $request |
||||||
0 ignored issues
–
show
The type
Illuminate\Http\Request was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
21 | * @param \Closure $next |
||||||
0 ignored issues
–
show
|
|||||||
22 | * @return mixed |
||||||
0 ignored issues
–
show
|
|||||||
23 | */ |
||||||
24 | public function handle($request, Closure $next) |
||||||
25 | { |
||||||
26 | return $next($request); |
||||||
27 | } |
||||||
28 | |||||||
29 | /** |
||||||
30 | * Handle tasks after the response has been sent to the browser. |
||||||
31 | * |
||||||
32 | * @param \Illuminate\Http\Request $request |
||||||
0 ignored issues
–
show
|
|||||||
33 | * @param \Illuminate\Http\Response $response |
||||||
0 ignored issues
–
show
The type
Illuminate\Http\Response was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
34 | * @return void |
||||||
0 ignored issues
–
show
|
|||||||
35 | */ |
||||||
36 | public function terminate($request, $response) |
||||||
37 | { |
||||||
38 | try { |
||||||
39 | $this->collector->collect([$request, $response]); |
||||||
40 | } catch (\Exception $e) { |
||||||
41 | app('log')->error('PrometheusMiddleware: failed to collect request metrics.', ['exception' => $e]); |
||||||
0 ignored issues
–
show
The function
app was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
42 | } |
||||||
43 | } |
||||||
44 | } |
||||||
45 |